News-Feeds

Tidying Code with Android Butterknife

Javascript News - Di, 2015-07-28 17:00

Creating code can sometimes be frustrating. Developers have to deal with redundant coding that is visually unattractive.

In this article, I will introduce an injection library for Android development that can help create more beautiful code. Android Butter Knife is an open source view “injection” library for Android created by Jake Wharton.

Continue reading %Tidying Code with Android Butterknife%

Card Tricks: Using Cards in Web Design Layouts

Javascript News - Di, 2015-07-28 15:00

From social networks to news websites, from online stores to common sites, cards are omnipresent on the web these days.

The rise of mobile technologies, bit by bit, led towards a new architecture of websites to the point that responsive design and adaptability are now a must. This contributed to the success of "cards" which are one of the top design trends in 2015.

However, we can be reasonably certain that cards are not just a passing design fad, but they will be the future of web development as they are provide one of the best ways to organize and display content in a coherent fashion.

So, in this article I'm going to explain you what "card design" is, and how it impacts on how you design.

Let's go!

Card Design Through the Ages

Although cards have now become very popular in web design, they have been an effective mean of visual communication for at least a thousand years. Firstly introduced as a game in 9th century Imperial China, cards later became useful in the business world.

Indeed, in the 17th century, "trade cards" made their first appearance in London to help people find business: they were an early example of the modern "business cards".

Today, the card is the preferred shape for coupons issued by stores and supermarkets, which people collect to get special discounts.

And most of us have to look no farther than our own wallet to find more cards that we care to mention: we have credit cards, loyalty cards, store card and even the standard driving license has the standardized format of the card.

Anyway, there is a strong link between the traditional use of cards and the application they found in web design: as common material cards usually contain information on two different sides, so web cards redirect to further content.

What are Cards on the Web?

From a web point of view, we can define a "card" as a small rectangle associated to a singular thought. Cards are full of interactive elements such as text, links, buttons or images but they suggest just one main action: the one of "clicking" through the card to further discover the content.

Indeed the principal aim of cards is to provide an overview of a certain topic in a condensed space and, if the reader is interested, with just one click he can open the subject in another page.

This is a great advantage for websites such as Facebook or Twitter, which have adopted the card design pattern, as they can feature a large amount of content while saving precious space.

Therefore, the most important characteristic of cards is the idea of the interaction they have to convey. When designing, web developers should remember that cards do not only have to feature news but they also have to engage the reader. That's why cards include buttons for likes, shares or links to read the full story.

Besides being useful, cards are a common design choice because they are compatible with responsive frameworks. The "broken-into-pieces" structure can create eye-catching user interfaces, but it is also perfect for mobile platform development too. Indeed, the design of a card has a very similar shape to the one of mobile phones screens.

Often we talk about 'fluid' layouts. Cards give us the small units that allow us to 'pour' our page components into differently sized and shaped screen layouts.

Why should we use cards?

Since cards give us built-in versatility, they can be used in different ways according to the required functions. So, let's have a look at some of the reasons to use cards:

  • They are a trend : although trends are, by their nature, transient things, using cards you can give your design an undeniable currency.
  • They inject order : the use of cards forces a level of organisation to your content.
  • They are ideal for responsive design: they can easily fit in websites and applications for mobile devices. The most important aspect is that, on smartphones, cards are easy to be stacked vertically to create a feed-like layout.
  • They encourage economy of thought: because they are bitesize, cards can never contain a lot of content. At first, this may seem a drawback, but I think it is a good thing! In a card you should feature only a hint of the full content, and then encourage the reader who wants more to click through to find out.
  • They are social: cards are perfectly suited to social media, not only because they are used by social networks, but because they make it possible for users to easily share content across social platforms and through emails.
  • All content is more equally weighted: cards help to solve the issue of which article you might feature at top of the site. With cards, pieces of content of the equal importance can live on the same page without you having to rank them. It is the reader himself who is going to choose what is important and what he wants to read.

Continue reading %Card Tricks: Using Cards in Web Design Layouts%

Backbone.js Basics: Bringing an App to Life with Events

Javascript News - Mo, 2015-07-27 20:00

In a previous tutorial, we plunged into the workings of Backbone.js, an MV* JavaScript framework for building applications. Building a small surf shop app (to help us keep track of surf boards in stock), we looked at creating models, grouping model instances into collections, and iterating over collections to create views. We also took it a step further by rendering each of our model instances into its own view, and grouping them together in a parent view. This is where we left off.

In this tutorial, we’re going to see the importance of that last step, and introduce some controller-type logic into the picture. I touched on controller-type logic and where it belongs in the last article, but let’s just drive the point home before we continue.

Separation of Concerns

In an MV* framework, views are typically responsible for the following:

  1. Rendering the UI, and displaying the data retrieved from the database and/or collections to the end user.
  2. Handling user input via events, and somehow communicating those events to the model.

The “somehow” part is where the controller logic comes in. In Backbone.js, we’re able to bind events to a view during its instantiation. If we wanted to add or remove stock, or delete a model completely, we’re able to do so. We’ll go through how to do this step by step, but for now, just imagine that we have a button in our view that allowed us to remove one item from stock. We can register that event in the view, which is essentially controller logic. When that button is clicked, we communicate with the respective model, and make the necessary updates to it. Changes in models can also trigger events that the view can handle, ultimately re-rendering the view and displaying the correct data.

So in a nutshell:

  1. A view renders model data, and registers events.
  2. When an event is fired via user input, we can run some kind of callback or function which communicates with the model.
  3. Inside the model, the logic gets performed. In a real world scenario, you’ll probably also be updating a database here.
  4. The model change fires off an event.
  5. The view picks up on that event, and acts accordingly, possibly re-rendering itself.

With all that in mind, we now need to think about how we’re going to register these events in the first place. Let’s move on to that.

Using Backbone Events

According to the Backbone events documentation:

Events is a module that can be mixed in to any object, giving the object the ability to bind and trigger custom named events.

There are many ways to handle events in a Backbone application, but we’ll be leveraging two ways:

  1. We’ll use the catalog of built in events in tandem with the listenTo method, which tells an object to listen to a particular event on another object.
  2. We’ll also delegate events using the events hash directly inside the view.

Let’s first take a look at leveraging the events hash inside the view instances.

Leveraging the Events Hash

Here’s a recap of the current code of the SurfboardView from last time:

[code language="js"]
var SurfboardView = Backbone.View.extend({

tagName: 'tr',

template: _.template($('#surfboard-template').html()),

render: function() {
this.$el.html(this.template(this.model.attributes));
return this;
}

});
[/code]

You’ll notice that each view instance gets wrapped in its own tr element, which is populated from the template we made before. Let’s edit that template a little bit to include a couple of buttons that will allow us to add and remove stock. We’ll also need to update the markup for the table:

[code language="html"]

Manufacturer Model Stock Add/Remove


[/code]

Each of our view instances should now have two buttons, but they do nothing at the moment. Let’s take a look at the events hash now, and see how we can register clicks on those two buttons. An events hash in Backbone generally looks like this:

[code language="js"]
events: {
'event target': 'callback'
}
[/code]

Continue reading %Backbone.js Basics: Bringing an App to Life with Events%

How to List Categories in WordPress Using the Categories API

Javascript News - Mo, 2015-07-27 19:00

In a previous article we saw how to easily work with categories in WordPress. We covered how we can sort our posts into different categories, which can then be edited or deleted.

Having covered the basics, it's now time to have a look at something that will be of more interest to developers: the Categories API, and how to retrieve and display category data.

Like the Links Manager API, the Categories API is a big topic, even bigger in terms of the number of functions available. In this article, we'll be covering one function that is useful when we want to list our categories.

Listing Categories

In the Links Manager API we find an important function that allows us to list our links. It's no surprise therefore that we find the same thing in the Categories API: wp_list_categories(), this is the function we'll work with here.

Basically, you have to call this function in the place you want to see your categories listed.

Continue reading %How to List Categories in WordPress Using the Categories API%

Cloud Connected NeoPixels Using The Particle Core

Javascript News - Mo, 2015-07-27 18:00

NeoPixels are a bright and colorful way to draw attention to wearable clothing, Arduino powered robots and more. As wonderful as all of those possibilities sound, there has been one thing I've wanted to try for a while. I've always wanted to control my NeoPixels via the cloud using a Particle Core (previously called a "Spark Core").

Particle Cores are microcontrollers that are quite similar to an Arduino Nano, however they have inbuilt Wi-Fi and come with a cloud based service that makes it easy to control your Core from afar. You can find out more on the Particle website. There are two newer versions of the device currently available for pre-order, the Particle Photon and the Particle Electron. The Photon has better reliability and is overall a faster and better upgrade to the Core. The Electron goes a step further and provides 2G/3G connectivity in over 100 countries, doing so via a global subscription service. It brings connectivity to a whole new and exciting level!

If you're looking to get started and you don't currently have a Particle device in your possession, try pre-ordering one of the newer options. At the time of writing, the Particle Cores are now all sold out! The demo below should still work on the newer devices, assuming that the NeoPixel library doesn't have any compatibility issues with the Photon. My Photon is still in the mail, so I can't check that just yet!

NeoPixels are a really neat brand of LED panel from Adafruit that can be hooked together in many different (and super colorful) ways. The NeoPixel grid I'll be using is an 8x8 NeoMatrix grid.

What We're Building

In this demo, we will be displaying a smiley face that will change depending on the mood sent to our Particle Core. If we send it a happy emotion, it will smile. If we send it a sad one, it will frown. We will send these emotions to it directly via very simple POST requests (you can replicate these by creating a form, AJAX site or server to initiate them, we will be keeping it simple, short and sweet by not defining one particular type of POST request method in this article).

The code and explanations for this demo assume you are familiar with your Particle Core, have set it up on your local Wi-Fi network and are familiar with how to flash code onto it via the Particle Build IDE. If you are new to the Particle Core and haven't tried anything with it yet, head to the Particle docs and read through the explanation on flashing apps first. Try flashing a simple LED blinking app to make sure you are all set up and ready to go. Assuming your Wi-Fi connectivity is pretty good, this should be a pretty smooth process.

The Demo

Want to skip ahead and see the final code? It is all available right here on GitHub.

The Sketch

Our sketch for our cloud connected, Particle-powered NeoPixel looks like so:

A few important points when putting together the sketch above:

  • We have a 4700μF, 10V capacitor (Adafruit recommends at least 1000 μF, 6.3V or higher). The one I used was from AdaFruit. They very strongly recommend placing one of these in your set up before connecting the power.
  • There is also a 330 Ohm resistor between the data output pin and the input to the NeoPixel (Adafruit recommends somewhere between a 300 to 500 Ohm resistor). Whilst it might work without this, it is safest to include it!
  • Adafruit also strongly discourage connecting the NeoPixels to a live circuit. At the very least, always connect ground first, 5V and then data. When disconnecting it - disconnect in the reverse order.
  • We are powering the NeoPixels via a battery as the Particle Core does not provide the 5V power on its own that the NeoPixels need to light up. In this case, Adafruit recommends you power the pixels first, before powering the Particle Core.
  • If you don't have a battery pack but understand how to use a logic level shifter to get it up to 5V, you can do that instead. I don't have a logic shifter to try this out!
  • I am definitely not an electronics expert and strongly recommend reading up on NeoPixels via the NeoPixel Uberguide before putting the above sketch together. NeoPixels can be pretty easy to damage so be careful! All I can say with confidence is that the above sketch I made did not damage my own NeoPixels and theoretically should be okay. Make your own judgements first before trying it at home.
The Code

Everything we will be creating will be coded up within the Particle Build Web IDE that we use to flash code onto our Particle devices over Wi-Fi. It uses a similar simplifed version of C++ to Arduino along with the same software library called "Wiring" for common input/output functions. In other words, if you are an Arduino fan, you'll be coding in pretty much the exact same way.

We start by creating a new app within the Build IDE and adding a rather important library to it. To add pre-existing libraries to your Particle apps, select the Libraries option which looks a bit like a bookmark in the bottom left corner.

From the screen that appears, choose the "Neopixel" library underneath "Community Libraries", once it loads click the button that says "Include in App" to add it to the app we are creating.

That will add in the following lines to your app:

[code language="c"]
// This #include statement was automatically added by the Spark IDE.
#include "neopixel/neopixel.h"
[/code]

Notice it says something about "Spark"? I mentioned it briefly at the start of the article but thought I'd point this out once more to avoid confusion. The name "Spark" will appear throughout the code as it was the old name for "Particle". I'd say the name will fully change over soon but my demo still has the old name in it. I'm not quite sure if they've updated the inner workings of their API or not yet.

After that, we define three constants for our app. We define the pin the NeoPixel grid is connected to, the number of pixels in our grid and the type of NeoPixel we have.

[code language="c"]
#define PIXEL_PIN D7
#define PIXEL_COUNT 64
#define PIXEL_TYPE WS2812B
[/code]

We then define our Adafruit_NeoPixel object with those three constants.

[code language="c"]
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);
[/code]

Continue reading %Cloud Connected NeoPixels Using The Particle Core%

Speeding up Existing Apps with a Redis Cache

Javascript News - Mo, 2015-07-27 16:00

We’ve gone through the basics of Redis in PHP before, but it’s time to cover a real life use case. In this tutorial, we’ll add it to an already deployed application to give the app the appearance of speed.

You can easily follow along by cloning the 0.6 release of the app.

The Problem

Before applying a solution, we need to have a clear definition of the problem.

The application in question, when executing a query, runs off to Diffbot’s API and makes it query the dataset. The subset is then returned and displayed. This can take up to 5 or so seconds, depending on the busyness of Diffbot’s servers. While the situation will undoubtedly improve as they expand their computational capacity, it would be nice if a query executed once were remembered and reused for 24 hours, seeing as the collection is only refreshed that often anyway.

“But what good is caching a single query?” you might wonder. It’s not like most people will search for one and the same thing often.

Well… as a matter of fact, not only has research shown that they will often search for one and the same thing (React is trending? Sudden influx of “react” queries), they will also very reliably search for prolific authors (or themselves). Considering the fact that implementing this cache costs us literally nothing (and actually reduces costs by reducing strain on the servers), adding it in is an easy win, even if it weren’t used as often as one would hope. There is no reason not to add it - it can only benefit us.

With the problem clearly defined, let’s handle the prerequisites.

Continue reading %Speeding up Existing Apps with a Redis Cache%

Counting Real Words with Ruby

Javascript News - Mo, 2015-07-27 14:00

Wait a minute, do you mean this blog post is just about counting words in a document? First, it is easy enough, and second, this can be done by any word processor on the fly.

You are right in that it is about counting words. However, the aim of this blog post is to show how flexible Ruby can be in meeting our desires on counting what we determine are considered words. This is in opposition to the word processors we use, which likely will not be able to determine such criteria.

Let me clarify this point a bit further. When a word processor is counting words, it takes the white space as a delimiter. As a result, what comes after that will be considered a new word and included in the word count.

What if you have a number, a standalone letter, email address, etc.? Do you consider those words? I don't. Word processors will not give you the option to filter the counted words.

Continue reading %Counting Real Words with Ruby%

Console Wars – PHP CLI Libraries

Javascript News - Sa, 2015-07-25 16:00

I have always been a big fan of console commands and I try to provide a command line interface (CLI) as much as possible in most of my PHP projects. In this article, I’ll briefly compare three PHP console command libraries: The Symfony console component (symfony/Console) The Hoa console (hoa/console) The Webmozart console (webmozart/console) Origin […]

Continue reading %Console Wars – PHP CLI Libraries%

Creating a Battery viz Using Node.js: Client

Javascript News - Fr, 2015-07-24 20:00

In the first part of this mini-series titled "Creating a Battery viz Using Node.js: Getting Started and Server", we discussed the details of the service we're building and what you'll learn. We then covered why we need a server and why I chose to create a RESTful service. While discussing how to develop the server, I took the chance to discuss how you can identify the current operating system and also how to use Node.js to run commands on it.

In this second and final part of this series, you'll discover how to build the client part to present the information to the users in a nice way.

Client

To present information to the users in a nice way, we should update the status of the battery every X minutes (or seconds), without reloading the page. We should be able to pause/resume updates, to avoid flooding our system when we don't need the information, or even when we are not looking at the page. To achieve this goal, we have to:

  • Schedule Ajax calls to our backend service over regular intervals of time;
  • Use a declarative framework that updates the DOM automatically and efficiently in response to changes to the data;
  • Exploit some jQuery utility function to make our life easier;
  • Use some nice images and CSS to make the dashboard visual appealing (as a bonus!).
Reactive Design

Discussing Ajax and asynchronous calls is certainly out of scope of this article (I'll provide a few useful links at the end of the post). For our purpose we can even treat them as black boxes that allow us to ask the server for some data, and execute some action once this data is sent back.

Let's take a minute, instead, to discuss reactive design and declarative frameworks.

An HTML page is, per-se and by creation, a static entity. That means that for a pure HTML page the content shown on the page remains the same every time it is rendered in a browser, and only depends on its HTML tags.
To bring the ability to change the appearance of the page dynamically, a long, long time ago Netscape introduced JavaScript, which allows, for example, to respond to mouse or keyboard events and change images or text accordingly.

As time passed, templates like Mustache or JSPs were also introduced to allow a certain degree of customization to the page at the moment of its creation, dynamically. For example, we can use a Mustache template in combination with JavaScript to load a different header panel for the page according to the language we set.

There are many libraries that help developers binding data to DOM nodes; most of them use JavaScript to describe the DOM elements to which the data should be translated, and requires updates to the page to be triggered manually (via JS). So we end up relying on the application's logic for deciding when the visualization should be updated and what changes ought to be made in response to data changes.

Declarative frameworks, instead, bind the data to DOM elements, and automatically update the DOM (in a minimal way) every time the data changes. Crucial point: this binding is also provided using templates in the presentation (the HTML markup) instead than in JavaScript.

Continue reading %Creating a Battery viz Using Node.js: Client%

How to Manage Time as a Freelancer

Javascript News - Fr, 2015-07-24 17:00

So you're a freelancer. Maybe you do some side work, maybe it's a full-time gig for you. Maybe you're the entrepreneur behind a small startup, still functioning like a freelancer.

In these and many other cases (I'm looking at you, workaholics who don't stop when you get home), people often have trouble managing time.

This article looks at some of the main time management challenges freelancers (and others) have to face, and considers some practical solutions.

What, Exactly, is "Work"?

It's important to understand the difference between work and leisure.

You sit at your desk flipping through Twitter; or skimming articles as you research a topic; or maybe note-taking; or contributing to an open-source project; or helping a colleague with a problem.

These activities can look like leisure activities—not only to outsiders, but even to yourself. Of course, in some cases they are! But often, they help to further your skills or career goals, and aren't simply for entertainment.

Redefine Your Concept of Work

If your activities help to boost your online presence or portfolio, or enhance your ability to make money or generate leads, then they're related to work. They are work. So treat them like work.

Maintaining a Discipline

Of course, you still have to prioritize. Do these activities have a higher priority than other work? Than leisure activities? Than family time? You need to work out a realistic balance between all these.

It's a difficult balance, as a freelancer or other working professional, because these "grey area" activities creep into your life. With social networking applications, news and email on our mobile devices, we can literally be working anywhere, at any time, in one way or another.

Setting clear boundaries of what is work, and then stopping work when it's time to do so—for however long you intended—is very important. Give yourself a mental break before returning your nose to the proverbial grindstone.

The Elusive Work-life Balance

This leads into a topic that many of us know and love—the elusive "work-life balance". In the United States, a 2014 Gallup Poll says that the average work-week is 47 hours. That, unfortunately, is not including the random, off-the-clock work done at home. And it definitely isn't the norm for freelancers or entrepreneurs, who may work many more hours than that! So how do you balance these things?

Don't Confuse Work for Leisure

Firstly, define what your work involves. Be clear about this, so that you don't fall into the trap of working when you're supposed to be relaxing with the family etc. (Are you sure you're relaxing with that phone in your hand?)

Schedule It

Secondly, plan ahead. If you want to have a bowling night, movie outing or date, schedule it. It makes it more real to you, and the time really seems blocked off, preventing you from filling it with other stuff.

Saying No

Thirdly, learn to say no. This is an age-old adage, but it's a good one to remember. And it applies, most of all, to yourself.

Freelancers and entrepreneurs are often constantly busy—either because it's in their nature to be, or because it's in the nature of self-employment.

Say no. Set aside time to manage the other areas of your life, and don't put any more tasks on this day's list. Say no to yourself, and to others, and begin filling another day.

Continue reading %How to Manage Time as a Freelancer%

15 Highly Effective Twitter Brand Bios

Javascript News - Fr, 2015-07-24 16:44

Crafting a great Twitter bio for your brand is really hard. After all, you have to convey what your company does, why people should follow you, and what kind of tweets your followers can expect—plus infuse it with your brand’s personality and voice, so that your audience feels a personal connection to your company. And […]

Continue reading %15 Highly Effective Twitter Brand Bios%

A Developer’s Introduction to iOS 9

Javascript News - Fr, 2015-07-24 15:00

Every year at WWDC, Apple unveils a new version of iOS. Ever since the announcement of iOS 2, Cocoa Touch developers know it’s a time to study documentation, view sample code, and ready their code for the new APIs.

This year with iOS 9, Apple has added many useful features and refined existing ones. While it wasn’t a ground-breaking change like iOS 7, there is a lot of new functionality to learn.

In this article, I will discuss some of my favorite changes and additions in iOS 9.

Continue reading %A Developer’s Introduction to iOS 9%

Hemingway Editor 2 Review

Javascript News - Do, 2015-07-23 22:00

As SitePoint’s editor for the PHP channel, I deal with a lot of text. Hundreds of emails and dozens of drafts fly before my eyes every week. This may not be obvious, but a lot goes into making the drafts publishable. There’s formatting, language corrections, image processing, code testing, syntax highlights, and more.

So it's important to be able to automate as much of the low-mental-effort work as possible. Automation allows editors to focus more on content and code. This, in turn, prevents the wasting of time. It is where tools like Hemingway can help most.

What is Hemingway?

Hemingway is a writing assistance tool. It keeps an eye on one’s phrasing and sentence structure, and suggests fixes. Typical fixes include shorter sentences, active instead of passive voice, and fewer adverbs. The app is also coupled with a built-in spellchecker for several English dialects.

I've taken a thorough look at Hemingway Editor 2, and what follows is a list of pros and cons. The list may or may not apply to you; it depends on how much writing or editing you do and in which format. As I programmer, I'm also interested in how Hemingway handles things like code and Markdown (MD) syntax. My hope is that the list will serve as a useful guideline when considering the tool for daily use.

Continue reading %Hemingway Editor 2 Review%

5 Minutes to Min-Safe Angular Code with Grunt

Javascript News - Do, 2015-07-23 20:00

Optimizing page speed is undoubtedly a primary focus for any developer building web applications. Task runners such as Grunt can play a pivotal role in the development process as they automate the activities of code concatenation and minification, which will be the main topics of this tutorial. Specifically, we’re going to use a set of Grunt plugins that will ensure our AngularJS application is safe for minification. Before I begin to discuss about AngularJS and minification, I want to highlight that developers of all skill levels can benefit from this tutorial, however basic knowledge of Grunt is desirable. In this article, we’ll be generating new folders with Grunt, so those new to using task runners will get a nice feel for how things work.

The Problem with Minifying Angular Applications

AngularJS applications are not min-safe by default. They must be written using the array syntax. Don't worry if you're confused as to what the array syntax exactly is, you have probably already written code that utilizes it. Let's take a look at two examples of AngularJS controllers that are being passed the $scope and $http parameters.

In the first example below, the module's factory and controller are wrapped in arrays that begin with DI annotations, and as you can see it does not follow the DRY (Don't Repeat Yourself) principle.

Continue reading %5 Minutes to Min-Safe Angular Code with Grunt%

Video: Designing a Simple Navigation Based App

Javascript News - Do, 2015-07-23 20:00

In this video I'll demonstrate how to create a navigation based app.

Loading the player...

Continue reading %Video: Designing a Simple Navigation Based App%

The WordPress Plugin Boilerplate Part 3: The Last Steps

Javascript News - Do, 2015-07-23 18:00

In the second part of this series, we prepared simple admin facing functionality for our plugin. We provided the users with an options page where they can tweak the plugin according to their preferences.

If you missed part 1 and 2, please find them below:

For this article, we're going to implement the public facing functionality of the plugin. This means that we're going to retrieve the user preferences, determine whether that specific post is outdated or not, and display the notice accordingly on its single post view. Let’s get started!

Preparing the Theme

We need to prepare our theme so that we can test it out later. We are going to use the Twenty Fifteen theme that is shipped by default with WordPress. Rather than populating the posts manually, we are going to use the theme unit test data provided by the Theme Review team to populate the posts.

We need to download the theme-unit-test-data.xml provided on the above Codex page and import it into our WordPress installation. The WordPress built-in import functionality can be found by navigating to Tools > Import from the sidebar.

We will be presented with various choices, and since we are importing the WordPress export file, we are going to choose WordPress. Depending on the WordPress installation, a plugin popup will be displayed if we do not have the WordPress Importer plugin installed. Just go ahead and install the plugin first if you do not have it and we will proceed with the actual importing process once it is done.

Continue reading %The WordPress Plugin Boilerplate Part 3: The Last Steps%

12 Best Slack Communities for Every Professional

Javascript News - Do, 2015-07-23 15:02

If your company isn't using Slack, chances are, the company next door is. In February, the team communication tool had 500,000-plus daily users—making it the fastest-growing business app ever. But Slack isn’t just dominating the cubicle. Recently, people have been using the platform to found and maintain “digital communities:” forums for collaborating and connecting with […]

Continue reading %12 Best Slack Communities for Every Professional%

Making Minimalism Work in Mobile and Web

Javascript News - Do, 2015-07-23 15:00

“Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius – and a lot of courage – to move in the opposite direction.”

This quote is attributed to a gentleman by the name of Ernst Schumacher, an influential thinker, economist and author of ‘Small Is Beautiful: a study of economics as if people mattered’. The Times listed it among the 100 most influential books published since World War II.

Ernst was mostly talking about financial systems but the quote should resonate with a lot of designers and UX people. Often the simplest designs – created with the fewest elements – can provide the largest bang for your buck. Of course, we are talking about minimalism.

As the well-worn maxim goes, “less is more” and no matter if you’re designing for mobile or gigantic retina monitors there are some effective tips and tricks, dos and don’ts that will help you get the most out of the little bits you’re using.

Wireframe Usage

There are really no hard and fast rules with minimalism aside from downsizing your content but one of the most effective steps you can take to achieve the minimal effect in your work actually happens before you start throwing down all of your elements. This is the step of using a wireframe.

It is a lot easier to start with a blueprint than going in swinging when it comes to scaling back and down. The great thing about this process is it can be done anytime, anywhere and on anything, unless of course you’re trying to write on someone’s walls then I amend my previous statement.

While you may already know the power of prototyping you must understand that with minimalism your sketch requires more attention to detail. Because you are going for a specific style it is important to understand the function of each and every element you place down. One thing that should be at the top of your consideration list while in this phase is your layout. Unique, non-traditional setups have chances of rendering a stunning design when you start subtracting your elements.

DO for Web

Go for modular, column and hierarchical layouts as this will yield you a better flow to your final look. Remember that manuscript grids or box looks in minimal design, while still effective in its own right, can have your design looking flat and boring.

DO for Mobile

Use an online wireframe tool for better planning. This will allow you to avoid layout issues if you go ahead and plan for each specific mobile device instead of working from paper to digital only to find out your minimal look isn’t exactly minimal.

DON’T for Web and Mobile

Never go into the wireframing stage without a list of the content that you need to have in the final design and don’t forget to experiment with more than one layout.

Refine & Simplify (or simplify until it breaks)

They say “You break it, you buy it” but if your site is on the brink of breaking then it's likely you’ve just nailed the best minimalistic look your design could yield. That, or you are seriously into a punk rock ethos and just like breaking stuff.

When you are designing you need to make sure that everything has a purpose. If you can’t find a reason why a certain item is there then you need to get rid of it. With minimalism designing it really is okay to start big and scale down. In fact it is a lot easier than starting with absolutely nothing.

Think of the removal stage as some good old fashion spring cleaning. Look at everything as a whole and then start throwing those fifteen plus pillows out the window, you really don’t need all of them and your design is going to reflect that. Essentially the key here is to dial back as much as you can. If you’re not sure if you have “broken” your design you simply need to run some functionality tests and see if your design’s meaning is still in tact.

DOs for Web

Create purpose within your design. Remember that a minimal website design isn’t about dumbing down your site’s content. It is about reducing unnecessary content so visitors can get to the good parts without missing anything.

DOs for Mobile

Due to the nature of mobile devices, smaller screens, you want to make sure that the spacing between your elements doesn’t look like you’ve just deleted something and forgot to place something there. You’re simplifying to create a clear eye path, not to show gaps.

DON’Ts for Web and Mobile

Never remove so much that your design doesn't have a focal point anymore. When you are simplifying there should always be a “look at me” element. This will allow you to design AROUND the focal point instead of designing FOR it.

Continue reading %Making Minimalism Work in Mobile and Web%

CSS is Alive and Well

Javascript News - Do, 2015-07-23 14:30

Due to the ever-growing popularity of React, Facebook’s user interface library, there has been some discussion on the topic of CSS and whether or not it has a future in its current form — that is, in the form of declarations in a separate stylesheet that provide presentation information for a given page or section of markup.

I’m not going to rehash the conversation or the pros and cons here. For those not familiar, here are a few links you can check out:

But what I will do is provide some strong evidence that CSS is alive and well.

The developers are restless

When I read the reactions and heated debates in comment sections of articles like this one or this one, two things become clear:

  • Developers are passionate about CSS
  • Developers are not happy with some of the proposed solutions for large CSS projects

The two links in the second bullet point in the introduction above are a slide deck and video presentation by Christopher Chedeau, a developer working for Facebook on the React project. This past week was the first time I tried delving into React a little bit, thanks to this great tutorial by Shu Uesegi. After that simple introduction, the slides gave me a little more context.

Christopher addresses 7 CSS architecture problems that he believes can be solved by using JavaScript to manage and implement styles. This is the kind of thing that makes a lot of purists shudder because, with React, you’re basically writing your markup and styles in your JavaScript — something that’s usually discouraged in keeping with “separation of concerns”.

The screenshot below captures one of Christopher’s pertinent slides in this regard, outlining the 7 problems that React attempts to address:

Christopher makes a great case for solving CSS’s problems in JavaScript, so I highly recommend you keep an open mind and check out his slide deck (although I’ll forgive him for saying that w3schools is his favorite website for learning JavaScript!).

So it’s clear that it feels like a CSS revolution is needed and some might say it’s already under way. But it’s also clear that CSS in its current form is not going away anytime soon.

CSS tips and tricks are in high demand

If you were keeping tabs on your RSS feeds and Twitter stream in the past week or so, then you probably came across my most recent CSS article. That was one of the most enjoyable articles to write, and judging by the incredible response in the comments and on social media, I’m glad to see that it was as enjoyable for readers.

[caption id="attachment_110386" align="aligncenter" width="800"] Artwork by SitePoint/Natalia Balska.[/caption]

The popularity of those types of articles demonstrates that developers still love CSS in its traditional form. Tweets by Ilya Grigorik, Smashing Magazine, CSS-Tricks, and others were shared and favorited hundreds of times. And the traffic to that article and its predecessor has been amazing.

The content in my articles is mostly covering stuff that’s been available in browsers for years, not just the new “CSS3” features. In fact, I intentionally tried to use as many cross-browser CSS tips as possible and the response has been overwhelming.

But this sort of thing is not unique to my article. Consider past CSS articles on other sites that have been hot in the community. Two that immediately come to mind are, not coincidentally, both by Heydon Pickering:

Continue reading %CSS is Alive and Well%

Model Web Pages with the Page Object Pattern

Javascript News - Do, 2015-07-23 14:00

We interact with web pages every day. On the low level, clicking on various HTML elements or entering text in text forms using input devices. What's the higher-level purpose of doing those things? It's trying to get something done. Completing a Google search, submitting a contact form, or rating something. The Page Object pattern is a great, object-oriented way to keep your code clean while accomplishing those higher-level things as your application grows.

Fundamentals of the Page Object Pattern

Why use the Page Object pattern? Two words: code reuse. Let me explain.

Suppose you're making an application that will go to a search engine and perform a search using a particular phrase. To do this, you will need to:

  • Go to the web page
  • Locate the HTML element where you can input text and enter your keyword (the text box)
  • Find the Search button and click it

Continue reading %Model Web Pages with the Page Object Pattern%