Wednesday, January 13, 2016

An in-Depth Walkthrough of Supercharging Apps with Blackfire

No one hates robust and scalable applications, especially when the database is growing quickly, and millions of requests need to be served on a daily basis. Profiling is a form of program analysis to measure the time and resources consumed by the program. With profiling, we can spot the performance bottlenecks in the code and do something about them. There is a variety of profiling tools out there, each taking a different approach.

Supercharged development

There are two main types of profiling methods: Sampling and Instrumentation.

In the sampling approach, the profiler takes samples of the call stack or the Memory at certain intervals, and updates its statistics. This method has a lesser effect on performance because it doesn’t modify the code at all. However, sampling has its overhead, which can be tuned by increasing the sampling frequency.

In the instrumentation approach, profiling instructions are inserted into the code either by the programmer or automatically by the profiler (at bytecode level). This approach has a significant performance impact on the application but provides precise details of what exactly is happening in the code at runtime.

Blackfire.io is the new generation of web profilers, which takes the automatic instrumentation approach, but without imposing a performance impact on our application. It’s been developed by Sensio Labs, the team behind the Symfony Framework.

What makes Blackfire special is that it helps us continuously test our application’s performance without adding a single line of code.

We can profile any PHP script using its fancy Google Chrome extension, or its command line tool.

Blackfire is easy to install as it is supported by many cloud server providers and VM boxes, including Homestead. In this tutorial, we’re going to learn how we can use Blackfire to build faster applications. As usual, we’ll use Homestead Improved to set up our development environment.

Continue reading %An in-Depth Walkthrough of Supercharging Apps with Blackfire%


by Reza Lavaryan via SitePoint

iOS 9: An Introduction to ReplayKit

5 Unexpected Places to Inject Personality into Your Site

Personality transforms a basic site into an engaging, entertaining one. It's what convinces first-time visitors to keep clicking and repeat visitors to come back. However, once you've added personality in all the obvious places – like your copy, visuals, fonts, and color scheme – you might not know what else to personalize.

If that's the case, check out these five places you can give your site a little personality.

1. The Error Page

Whether it's your fault or theirs, your site visitors will understandably be a little dismayed when they're shown an error page. But with a helpful, visually compelling, even amusing 404 or 500 page, you can make them forget their dismay-and build your brand in the process.

Let's look some well-designed error pages for inspiration.

Github 404

Every detail of GitHub's 500 is great.

First, the illustration perfectly conveys the personality of GitHub: quirky, off-beat, not too serious. As you move your mouse around, the illustration shifts in response – a nice little piece of coding.

The copy is also on-brand, from the "Oops!!!" with not one but three exclamation marks and the helpful suggestion at the bottom.

The Muse's 404 page is similarly well-executed.

The Muse’s 404 page.

It's hard not to smile at the doleful puppy, and his explanation ("The address you entered is invalid, or maybe I ate it,") is pretty cute.

Rather than simply presenting links to various sections of the site, it says, "We have some great suggestions for where to go from here!"

Even NASA has crafted a creative error page.

Website: NASA

Since a variety of audiences use the site-from young kids to professionals-it was wise to keep the message playful and space-themed without going overboard. (The space porn doesn't hurt, either.)

2. The FAQ

FAQ pages tend to be a little dry. That's understandable: they need to communicate lots of information as clearly, concisely, and matter-of-factly as possible.

Yet if you can do that while also putting some personality in, your visitors will thank you.

Casper has one of the best FAQ pages I've seen.

Casper animation

There are five main topics-each with its own adorable illustration. This makes reading about the "special blend of three types of foam" of a Casper mattress fun, rather than boring.

To enliven its support center, Squarespace competitor Jimdo used descriptive icons.

Jimdo

Not only does this design technique make finding the right section intuitive, but it's also in-keeping with how visual the rest of the Jimdo site is.

Product Hunt used a different approach. The styling of the Product Hunt FAQ is relatively traditional (although it maintains the overall look of the site), but there's personality in the copy.

Product Hunt

For example, the first question is, "What's going on here?" This answers "What is Product Hunt?" in a more human way. There's also some easter egg questions, such as, "Where are my keys?"

Continue reading %5 Unexpected Places to Inject Personality into Your Site%


by Aja Frost via SitePoint

Self Sizing Cells with UITableView and UICollectionView

For a long time, a big challenge for iOS developers was custom heights and sizes for UITableView and UICollectionView Cells. There were ways to achieve this such as ‘Auto Layout’, but they were ‘hacky’ and not fully implemented.

Previously to calculate height, developers had two options.

If using Auto Layout, a developer could create an offscreen cell, layout the content in tableView:heightForRowAtIndexPath: and then get the height (using systemLayoutSizeFittingSize:).

If not using Auto Layout, the height has to be calculated manually for each cell and the values cached to avoid slowdown.

With iOS 8, UITableViews and UICollectionViews have embraced Auto Layout. In this post, we will cover what you need to know to support UITableViews in your apps.

Continue reading %Self Sizing Cells with UITableView and UICollectionView%


by Arvindh Sukumar via SitePoint

lodash – JavaScript Utility Library

lodash is a modern JavaScript utility library delivering consistency, modularity, performance, & extras.


by via jQuery-Plugins.net RSS Feed

Offer: Foolproof Prep for the AWS Certification Exams

http://ift.tt/1U4xQy1

Take the next steps in your tech career, five minutes at a time. Get the Amazon Web Services Associate certification bundle for $29.

This bundle is packed with three courses full of mini lectures designed to help you ace the AWS Certified Solutions Architect – Associate, AWS Certified Developer, and AWS Certified SysOps Administrator Associate exams. The lectures range from five to 20 minutes long, so you can study up on material whenever you have a few minutes to spare—no cram sessions required. And at the end of each course, take a mock exam that’ll give you hands-on practice for test day.

Grab this Amazon Web Services Associate certification bundle for $29 at SitePoint Shop!

Continue reading %Offer: Foolproof Prep for the AWS Certification Exams%


by SitePoint Offers via SitePoint

IFTTT and WordPress: Automating (Almost) Everything You Do With Your Website

How do you deal with the mundane, repetitive tasks in your WordPress project? Probably with some plugins. Or maybe you choose to (or have to) do them by yourself, manually. Wouldn't it be nice if you could do some of those tasks automatically and without any plugin load?

Turns out, you can. In this tutorial, we're going to get to know IFTTT, an automated task manager that will help you along the way.

Repetition Is Boring, Automation Is Fun

You want to share your blog posts in your social network accounts after you publish. You don't want to do it manually, so you install a WordPress plugin to share the posts for you.

You need to have a backup of your articles in your Dropbox folder, but you don't want to deal with SQL files to find a single post. You can't find a plugin that does the deed for you, so you have to copy and paste the posts into Word files by hand.

You want to post some of your Instagram photos to your blog, but not all of them. (Because you want to share the interesting paintings you see around the world, but not that photo of your dog licking your husband's face.) You install yet another WordPress plugin that selects photos with specific tags from your Instagram feed, and posts them. Or maybe you just do it manually.

Why on earth would someone want to put up with all those repetitive, boring tasks? I'd hire an online assistant if I had to do all those things... and didn't know about IFTTT.

Enter IFTTT: A Task Scheduler for You on the Web

With a catchy slogan, "Make Your Work Flow", IFTTT (If This Then That) "gives you creative control over the products and apps you love", in their own words.

In IFTTT, you create recipes, little workers that run every 15 minutes and do things with your channels, the apps and website profiles and other things. You can connect to your channels as if you're authorizing a new application in Facebook, Twitter or whatever. The recipes can contain ingredients, basically the data variables that are fetched from the channels, like the Instagram hashtag or the permalink of a Reddit post.

The recipes consist of two parts: Triggers and Actions. If the trigger is pulled, the actions run, hence the name "If This Then That". For example, if you favorite a song on Spotify, IFTTT can post the song on Twitter. Or if it's going to get colder tomorrow, IFTTT can raise your home's thermostat with Nest. Pretty cool, huh?

IFTTT can do all kinds of awesome things, but we're going to stick with WordPress-related awesomeness in this tutorial.

IFTTT Recipes to Automate WordPress Tasks

As I said, you have to connect to channels to activate recipes. WordPress, for example, is a channel that needs your login credentials. Facebook just needs you to authorize the IFTTT application. Android or iOS-related channels need one of IFTTT's Android or iOS apps (called IF and DO) to work properly.

Don't let this confuse you. All the recipes in IFTTT guide you to connect the channels needed, if they're not connected before. Once you connect a channel (WordPress, for instance) to IFTTT, you don't have to do the same thing again with another recipe.

Let's begin!

Starting Off With the Basics: Auto-Posting to Social Media

When it comes to automating tasks on WordPress, people tend to think auto-posting published posts to their social network accounts. And that's perfectly natural because this is one of the most popular tasks that's performed after publishing a post. 

So, there are lots of plugins that help you submit your posts to social media automatically. But if you're looking for a solution that doesn't involve a plugin using up your server's resources, IFTTT is your guy. Here are some recipes that help you with the tasks:

#HashtagWatch: Post Photos of a Tag to WordPress

Let's go on with the example I made up before: What if you want to post specific Instagram photos to your WordPress blog, but not all of them? With this recipe, you can simply connect to the Instagram and WordPress channels, and then set a #tag to post to WordPress. Say, if you set #gourmetfastfood, your Instagram pictures with only that tag will be posted to your WordPress blog.

Publishing Uploaded YouTube Videos to Your Blog

Here's another recipe that's similar to the one above, but uses YouTube as the "trigger": When you upload a video to YouTube, IFTTT can publish a post (or save as a draft) using the title and the video embed code. In the "Advanced Settings" of this recipe, you can set categories and tags, and edit the title and the post content. The "ingredients" (data variables) include the video's creation date, title, description, URL, author name and the embed code.

Take a Photo, Post It to WordPress

Ever wanted to take a photo and immediately share it on your WordPress blog? Certainly WordPress's own apps could help you with that, but if you want to share photos even faster, you can use the DO Camera app by IFTTT. With the app and this recipe, you can snap a picture and instantly publish it on your WordPress blog.

Trello to WordPress and WordPress to Trello Awesomeness

As a fan of Trello (and WordPress, of course), these two recipes are my favorite.

  • With the Trello to WordPress recipe, you can create cards on Trello that turn into WordPress posts automatically.
  • And with the WordPress to Trello recipe, you can make Trello create cards automatically when you post to WordPress.

Wrapping Up

Well, that was fun. Using the power of automation with IFTTT in your WordPress projects isn't mind-blowing, but it certainly works the creative chakra, am I right?

And now, let's hear your ideas! Can you come up with more ways to automate your tasks in WordPress? Share your ideas for IFTTT recipes with us in the Comments section below. And don't forget to share this article with your friends!


by Barış Ünver via Envato Tuts+ Code