Wednesday, March 30, 2016

Create an Alexa Skill and Get Three Months Free on Envato Tuts+

How to Build a Trivia Game for Amazon Echo in Under an Hour

5 #ContentMarketing Strategies to Increase Blog Traffic

5 Content Marketing Tactics to Increase Blog Traffic

Why is blog traffic important? Because most buyers these days make up their minds on whether to purchase a product or contract a service by reading your blog, finding out new information on which they base their new, researched purchase.

A statistic in DemandGen’s 2015 content marketing survey report shows that over 75% of B2B (business to business) purchasers base their decisions on content the use for research.

Have you ever wondered how many posts get published each day? Over 1 milion posts! Yes, that’s right! Just take a look at this amazing blogging statistics meter from worldometers.info.

Now you’re thinking: “With so many blog posts being published each day in the world, how can I make mine stand out?” That’s good because that’s exactly what I aim to help you wit in this article.

Not so long ago bloggers would have the mentality that if they would write quality articles, people will naturally find them and bring their blog lot of traffic. I am sorry to say it, but things just don’t work that way.

In order to really bring value to your readers with your articles, you have to first reach your audience; your content needs to be easily found by your target audience.

by Mike Dane via Digital Information World

Get 1,200+ Design Elements for $19

Get 1,200+ design elements for $19

Whether you're creating marketing materials for a client, working on your comic book side project, or designing your own greeting cards, we've got something that'll save you a ton of time on any design project. Get the Mega Graphics Bundle for $19 at SitePoint Shop.

This valuable bundle usually goes for $1,325, so don't miss your chance to grab it for 98% off. You'll get 1,260 elements, all with an Extended License so you can use them again and again. Create greeting cards with the hundreds of love patterns and holiday elements. Choose from dozens of logo designs for your small business. Dress up fliers, business cards, and posters with colorful backgrounds and nature and weather elements. And work on your comic book with dozens of comic book elements and speech bubbles.

Save 98% on the Mega Graphics Bundle. Get it for $19 at SitePoint Shop.

Continue reading %Get 1,200+ Design Elements for $19%


by SitePoint Offers via SitePoint

Building a Filtering Component with CSS Animations & jQuery

Some months ago, I wrote an article about MixItUp, a popular jQuery plugin for filtering and sorting. In today’s article, I’ll show you how to build your own simple filterable component with jQuery and CSS animations.

Without further ado, let’s get started!

Setting Up the HTML

As a first step, I’ll show you the HTML structure of the component. Consider the following markup:

[code language="html"]
<div class="cta filter">
<a class="all active" data-filter="all" href="#">Show All</a>
<a class="green" data-filter="green" href="#">Show Green Boxes</a>
<a class="blue" data-filter="blue" href="#">Show Blue Boxes</a>
<a class="red" data-filter="red" href="#">Show Red Boxes</a>
</div>

<div class="boxes">
<a class="red" data-category="red" href="#">Box1</a>
<a class="green" data-category="green" href="#">Box2</a>
<a class="blue" data-category="blue" href="#">Box3</a>

<!-- other anchor/boxes here ... -->

</div>
[/code]

Notice that I’ve set up some pretty basic markup. Here’s an explanation of it:

  • First, I’ve defined the filter buttons and the elements that I want to filter (we’ll call them target elements).
  • Next, I’ve grouped the target elements into three categories (blue, green, and red) and I gave them the data-category attribute. The value of this attribute determines the category that each element belongs to.
  • I’ve also assigned the data-filter attribute to the filter buttons. The value of this attribute specifies the desired filter category. For instance, the button with the data-filter="red" attribute/value will only show the elements that belong to the red category. On the other hand, the button with data-filter="all" will show all the elements.

Now that you’ve had an overview of the required HTML, we can move on to explore the CSS.

Setting Up the CSS

Each time a filter category is active, its corresponding filter button receives the active class. By default, the button with the data-filter="all" attribute gets this class.

Box with active class

Here are the associated styles:

[code language="css"]
.filter a {
position: relative;
}

.filter a.active:before {
content: '';
position: absolute;
left: 0;
top: 0;
display: inline-block;
width: 0;
height: 0;
border-style: solid;
border-width: 15px 15px 0 0;
border-color: #333 transparent transparent transparent;
}
[/code]

In addition, I’m going to use flexbox to create the layout for the target elements.

Using flexbox for the layout

See the related styles below:

[code language="css"]
.boxes {
display: flex;
flex-wrap: wrap;
}

.boxes a {
width: 23%;
border: 2px solid #333;
margin: 0 1% 20px 1%;
line-height: 60px;
}
[/code]

Lastly, I’m defining two different CSS keyframe animations that I’ll use later on to reveal the elements:

[code language="css"]
@keyframes zoom-in {
0% {
transform: scale(.1);
}
100% {
transform: none;
}
}

@keyframes rotate-right {
0% {
transform: translate(-100%) rotate(-100deg);
}
100% {
transform: none;
}
}

.is-animated {
animation: .6s zoom-in;
// animation: .6s rotate-right;
}
[/code]

With the markup and CSS in place, we can start building the JavaScript/jQuery.

Continue reading %Building a Filtering Component with CSS Animations & jQuery%


by George Martsoukos via SitePoint

Quick Tip: Understanding the Yield Keyword in Python

When we call a function in Python, the function will normally start working until it encounters a return, exception, or reaches its end – after which it returns control back to the caller. Whenever you call that function again, the process will start from scratch!

Say that you asked a person to track the red cars on the road. The person will keep getting a question asking them if they spotted a red car or not, and the person in turn would answer with either ‘yes’ or ‘no’. If the person answered ‘yes’, the number of times the red car was spotted will increase.

Let’s see how we can do this in Python:

import time

def red_cars(answer):
    n = 0
    while True:
        if answer == 'yes':
            n = n + 1
            return n
        else:
            return n

stop = time.time() + 5 * 60
while time.time() < stop:
    answer = raw_input('Did you spot a red car on the road? ("yes" or "no"): ')
    times = red_cars(answer)
    print 'You have spotted ' + str(times) + ' cars so far!'

If you run the program, what do you notice? Did you notice that the number of times for the ‘yes’ answer is always capped at 1, and when you answer ‘no’ the number of times gets 0 regardless of answering ‘yes’ before?

Here is where Python’s yield keyword comes into play. yield is a means by which we temporarily hand control to the caller, and expect to continue from the point at which control has been handed over.

Before giving the solution to the above example, let me demonstrate a very simple example to better illustrate how yield works.

Say we have the following simple Python script:

def step_by_step():
    return 'step 1'
    return 'step 2'
    return 'step 3'
    
step = step_by_step()
for i in range (3):
    print step

If you run the script, you will get the following output:

step 1
step 1
step 1

Now, if we use yield instead, as follows:

def step_by_step():
    yield 'step 1'
    yield 'step 2'
    yield 'step 3'
    
step = step_by_step()
for i in range (3):
    print step.next()

The output would be as follows:


step 1
step 2
step 3

As you can see, we were able to create a series of values, as for each call the function continues from the point where it yields a value. This type of function is called a generator. Such function creates a generator iterator, as with each call to the method next() we move to the next yield statement.

If we come back to our main example (red cars), it can be written as follows to perform the required task:

import time

def red_cars(answer = None):
    n = 0
    while True:
        if answer=="yes":
            n = n + 1
            answer = yield n
        else:
            answer = yield n

car_color = red_cars()
car_color.next()

stop = time.time() + 5 * 60
while time.time() < stop:
    answer = raw_input('Did you spot a red car on the road? ("yes" or "no"): ')
    print 'You have spotted ' + str(car_color.send(answer)) + ' cars so far!'

Thus, as we can see, yield is deemed important when we are interested in resuming execution at the last point where the function (generator) exited, and where we are also interested in keeping the values of local variables between the different calls – unlike normal functions, where such values are destroyed when exiting the function.

Continue reading %Quick Tip: Understanding the Yield Keyword in Python%


by A. Hasan via SitePoint

4 Things I Wish I’d Been Told at the Start of My Freelance Career

I’ve been freelancing for around 5 years now... full time for the last 3. I enjoy the freedom, the high pay I’ve been able to achieve, and perhaps most importantly, the diversity of activities.

[author_more]

Of course, you can’t do something for 5 years without learning a few things, so I wanted to take a moment today to share a few of the things I wish I’d known back at the beginning. I’ll also mention a few things I managed to avoid that seem to be common tripping points for many freelancers.

I hope that’s enough intro for you, because we’re diving right in.

1. Pricing Has Nothing to Do with Service Quality

A lot of people tend to think that price is directly related to quality. Sure, you know of some exceptions, but on average, people to tend to earn what they’re worth, right?

No. Not with freelancing. In fact, you need to completely get out of that mentality if you want to make real money as a freelancer.

The reality of capitalism is that pricing has nothing to do with quality. Pricing is 100% determined by what people are willing to pay. As a freelancer, my service cost is based entirely on what I can negotiate from a client as opposed to the actual value of my work.

If you want to make more money as a freelancer, you don’t need a better service, you need better negotiating skills. Here’s the cliffnotes for making that happen:

How to Negotiate Higher Pay

Quality is important, of course, and we’ll talk about that next, but it has virtually nothing to do with your pricing. I’ve made $12 and $800 for essentially the exact same article. If you can change your mentality and understand that price is a matter of how much your client is willing to pay, you can immediately begin making more money for the exact same amount of work.

2. Your Long-term Success Will Depend Entirely on Quality

While the quality of your work will not determine how much you earn on any given project, it WILL determine how many projects you get from repeat and referred clients, which tend to make up the bulk of a successful freelancer’s income.

Don’t let this detract from my previous point. You can do $800 quality work and get paid $12 the rest of your life if you fail to grasp point #1.

If, however, you are successfully charging $800 for $12 quality work, you will typically find yourself failing to attract recurring business. There are always exceptions, of course, and if you are in a market where clients tend to have limited understanding of the service provided, you might be able to get away with scamming. But honestly, if your goal is simply to rob people, becoming a freelance service provider is a horribly inefficient way to accomplish that.

The best way to succeed over the long haul is to provide consistent value to everyone you work with. When a client comes away thrilled with your work, there’s a fantastic chance that will turn into additional work and a referral or two down the road. When this happens with EVERY client you work with, you are essentially building a passive lead-generation network.

Focus on doing quality work and continue to improve as your career progresses. This is THE best way to achieve long-term success as a freelancer.

Continue reading %4 Things I Wish I’d Been Told at the Start of My Freelance Career%


by Jacob McMillen via SitePoint