by via Awwwards - Sites of the day
"Mr Branding" is a blog based on RSS for everything related to website branding and website design, it collects its posts from many sites in order to facilitate the updating to the latest technology.
To suggest any source, please contact me: Taha.baba@consultant.com
Thursday, February 11, 2016
Out Monster The Monster
by via Awwwards - Sites of the day
Don’t Make These 4 Infographic Mistakes
Infographics rely on high quality visual design in order to successfully convey your message and with business intelligence on the rise, there’s more and more content to visualize. This means that in order for your company’s graphics to stand out, you need to hit all the right factors. Design errors will stick out like a sore thumb.
Before you start developing new visuals, learn the basics. Here are 4 common design mistakes you need to avoid if you want your infographics to succeed.
by Larry Alton via Digital Information World
Getting Started with Microservices Using Syncano’s Codeboxes
This article was sponsored by Syncano. Thank you for supporting the sponsors who make SitePoint possible.
Syncano is a really fascinating platform that gives you a hand with the backend and middleware of applications. We had a look at the capabilities of Syncano in my last article on How to Build a Daily Affirmations SMS Service with Stripe & Syncano where we put together a service that sent out daily SMS affirmations in a subscription service. All the backend and middleware is taken care of by Syncano. Very neat!
In this article, we are going to focus on Syncano’s concept of CodeBoxes more closely — what CodeBoxes are, how we make and run them in Syncano, and how we can connect them to external APIs. We’ll put together a demo using GitHub’s API to showcase just what is possible.
What is a CodeBox?
A CodeBox is a snippet of code that can be run in the cloud in a number of ways. Each CodeBox is intended to provide a single piece of our web application puzzle — one bit of functionality that contributes to the app as a whole.
To provide specifics about what we’d like the CodeBox to do in our web application, we can pass in arguments to a CodeBox, just as you would pass in arguments to a HTTP request. For example, we could have a CodeBox that looks up song lyrics stored in a database. It would accept two parameters, the song name and artist. A sample input for that CodeBox could be “Jack Sparrow” and “The Lonely Island”. The CodeBox would run using those parameters and provide the song lyrics if it knew the song. If not, it’d return a message saying it couldn’t find them.
One of my favourite things about CodeBoxes is that they can be created in a number of different languages. Syncano supports CodeBoxes written in Python, Golang, Node.js, Swift and Ruby. Not only that — CodeBoxes written in different languages can all work together to create a functioning web application. It is incredibly flexible!
The Code
For those who would like to follow along with the examples, the working code is available on GitHub. Use it, enjoy it, expand it — do as you wish.
How to Create a CodeBox
To illustrate the use of CodeBoxes in a Syncano application, we’ll be putting together a really simple app that looks up pull requests from a GitHub repo. It’s about time we had a way to keep an eye on how our GitHub team projects are going right?
To begin, we head to the Syncano Dashboard and create a new app. If you’re totally new to Syncano and need a bit of guidance on this, have a look at the previous SitePoint article on Syncano — it should help you out.
Then, we head to the “CodeBoxes” section on the left and click either of the icons with a plus on it to create a new CodeBox:
Then, in the popup box that appears:
- Enter in a title for your CodeBox - This can be a short but clear label to help you find it in the Dashboard, e.g. “Find GitHub Pull Requests”.
- Enter in a description for your CodeBox - This isn’t needed but I prefer to use it to include more details on exactly how the CodeBox is going to work, e.g. “Looks up and filters pull requests from a GitHub repo”.
- Choose the runtime environment you’d prefer to work in - In this article, we’ll be using Node.js, so if you’d like to follow along directly, choose that one!
- Click “Confirm” to create that CodeBox!
Once you have created your CodeBox, Syncano should bring you straight to the CodeBox editing screen. You’ll see a blank page with the text # Start coding!. We should follow that instruction and put something simple in there as an initial test run.
Running a CodeBox
Enter in a simple console.log() statement and then click the run button to the right to give it a test run:
Then, if we scroll down the page, we find a result screen with the successful output:
Continue reading %Getting Started with Microservices Using Syncano’s Codeboxes%
by Patrick Catanzariti via SitePoint
How to Build an SMS Appointment Reminder App with Twilio
In this tutorial we’re going to build an SMS reminder app with Node.js. We’re going to use the user’s Google Calendar to get appointments and then send the text message with Twilio.
Setting Things Up
First you’re going to need to have a Google account and a Twilio account. If you don’t have those yet, you can go ahead and sign up. Here are the links:
You don’t need to worry about Twilio, it’s free to try.
Google Console Project
Once you have a Google account, go to the Google Console and create a new app. By default the Google Console page shows you the dashboard of the most recent app that you’ve worked on. But if you haven’t work on any projects yet it will show the following:
From there you can click on the select project menu at the upper right corner and select create a project. This opens a modal window which allows you to enter the title of the project.
Once the project is created, the dashboard is displayed. From there you can click on the use Google APIs, search for the Google Calendar API and enable it.
Once the API is enabled, it will ask you to create credentials. Click Go to Credentials to begin setting it up. This will show you the following:
Click on the Add credentials button then select OAuth 2.0 client ID.
This will ask you to configure consent screen first. Click on configure consent screen.
Enter a value for the Product name shown to users text field and click on save.
Once that’s configured you can now create the client ID. Select Web application for the application type, leave the default name (if you want), enter http://localhost:3000/login for the Authorized redirect URIs then click create.
This opens a modal which displays the client ID and client secret. Take note of those for now as we will be using them later.
Twilio
Once you’ve created a Twilio account, go to the settings page and take note of the values for the AccountSID and AuthToken under the Live API Credentials.
Next go to the programmable voice dashboard. This is where you can see the sandbox number. You can use this number for testing twilio. But Later on you will need to buy a phone number so that the text messages sent by twilio won’t have “sent from twilio sandbox” added to it. Another limit of the Twilio sandbox number is that it can only be used with verified numbers. Which means you have to register a phone number with twilio in order to send a message to it. You can do this from the manage caller IDs page.
Building the App
Now we’re ready to build the app. Before we proceed I’d like to provide a brief overview on how we’re going to implement the app. There’s going to be three major files: one for the server, one for caching events from Google Calendar and one for reminding the user. The server is used for allowing the user to login and obtaining an access token. The events will be saved in the MySQL database and the global app configuration will be added in a .json file. Node’s implementation of cron will be used for executing the task for caching events and reminding the user.
Installing the Dependencies
On your working directory, create a package.json file and add the following:
{
"name": "google-calendar-twilio",
"version": "0.0.1",
"dependencies": {
"config": "^1.17.1",
"cron": "^1.1.0",
"express": "^4.13.3",
"googleapis": "^2.1.6",
"moment": "^2.10.6",
"moment-timezone": "^0.4.1",
"mysql": "felixge/node-mysql",
"twilio": "^2.6.0"
}
}
In this file we’re specifying the name and version of the libraries which our app depends on. Here’s a break down of usage for each library:
config- used for storing and retrieving global app configuration.cron- used for executing a specific task at a specific time of the day. In this app we’re using it for running the task for caching events from the users Google calendar and sending text reminders.express- the defacto web framework for Node.js. We’re using it to serve the login page.googleapis- the official Node.js client for Google’s APIs.moment- a date and time library. We’re using it to easily format the dates that we get from the Google Calendar API.moment-timezone- the timezone plugin for moment. This sets the default timezone for the app.mysql- a MySQL client for Node.js.twilio- the official Twilio client for Node.js. This allows us to send text reminders.
Execute npm install from your terminal to install all the dependencies.
Database
As mentioned earlier, we’re going to use the MySQL database for this app. Go ahead and create a new database using the database management tool of your choice. Then use the following SQL dump file to create the tables: appointment-notifier.sql.
There are two tables in the database: users and appointments. The users table is used for storing the user’s data. In the case of this app, we’re only going to store one user, and only the access token is stored.
The appointments table is used for storing the events which we got from the Google Calendar API. Note that it has no user_id field in it because we only have one user. And we’re going to fetch all the rows which have zero as the value for the notified field.
App Configuration
On your working directory, create a config folder then inside it create a default.json file. This is where we will put the global app configuration. This includes the timezone, the phone number to which we’re going to send the reminders, the database, google app and Twilio settings.
Here’s the template, be sure to fill in all the fields.
{
"app": {
"timezone": "Asia/Manila"
},
"me": {
"phone_number": ""
},
"db": {
"host": "localhost",
"user": "root",
"password": "secret",
"database": "calendar_notifier"
},
"google":{
"client_id": "THE CLIENT ID OF YOUR GOOGLE APP",
"client_secret": "THE CLIENT SECRET OF YOUR GOOGLE APP",
"redirect_uri": "http://localhost:3000/login",
"access_type": "offline",
"scopes": [
"http://ift.tt/OTpgCW",
"http://ift.tt/16kSG6F"
]
},
"twilio": {
"sid": "YOUR TWILIO SID",
"secret": "YOUR TWILIO SECRET",
"phone_number": "+YOUR TWILIO PHONE NUMBER / SANDBOX NUMBER"
}
}
Common Files
As good developers we need to avoid code repetition as much as we can. That’s why we need to put code that’s needed by those three major files (server, cache, notify) that I mentioned earlier into separate files. Create a common folder on your working directory. This is where we’re going to add the common files.
Database
Create a db.js file inside the common directory then add the following:
var config = require('config');
var db_config = config.get('db');
var mysql = require('mysql');
var connection = mysql.createConnection({
host: db_config.host,
user: db_config.user,
password: db_config.password,
database: db_config.database
});
exports.db = connection;
This uses the config library to get the configuration values that we’ve added earlier on the config/default.json file. Specifically we’re getting the database configuration so that we can connect to the database. Then we’re exporting this module so that we can use it later on from another file.
Time
The time.js file is used for setting the default timezone with the moment-timezone library. We also export the value for the timezone since we’re going to use it later when running the two cron tasks (caching events and notifying users).
var config = require('config');
var app_timezone = config.get('app.timezone');
var moment = require('moment-timezone');
moment.tz.setDefault(app_timezone);
exports.config = {
timezone: app_timezone
};
exports.moment = moment;
The google.js file is used for initializing the Google client and the OAuth2 client. In order to initialize the OAuth2 client we need to pass in the client ID, client secret and the redirect URL which we have added in the configuration file earlier. Then we initialize the Google Calendar service. Lastly, we export the OAuth2 client, calendar and the Google configuration.
var config = require('config');
var google_config = config.get('google');
var google = require('googleapis');
var OAuth2 = google.auth.OAuth2;
var oauth2Client = new OAuth2(google_config.client_id, google_config.client_secret, google_config.redirect_uri);
var calendar = google.calendar('v3');
exports.oauth2Client = oauth2Client;
exports.calendar = calendar;
exports.config = google_config;
Continue reading %How to Build an SMS Appointment Reminder App with Twilio%
by Wern Ancheta via SitePoint
10 of the Most Popular Free WordPress Themes
There are thousands of free and premium WordPress themes available. Some of these themes are extremely popular and used by hundreds of thousands of users. In this article, I will list the 10 most popular free themes from 2015 available at WordPress.org.
Some of these themes featured below are more popular than others. I am not going to list the WordPress 'Twenty' series themes in this article (e.g Twenty Sixteen, Twenty Fifteen etc.). It's very difficult to beat all of the 'Twenty' series themes. They come pre installed with WordPress. The most popular option, Twenty Fifteen, has 1+ million active installs. The least popular 'Twenty' series theme, Twenty Sixteen which has just recently been released, has 100,000+ active installs.
Continue reading %10 of the Most Popular Free WordPress Themes%
by Tahir Taous via SitePoint
How to Use ARIA Effectively with HTML5
ARIA stands for ‘Accessible Rich Internet Applications’ and can help make your website more accessible to people with disabilities such as hearing or visual impairment. Let’s see how we, as developers, can make life easier for them.
One way we can use ARIA is by adding it to our HTML. You may already be familiar with semantic elements in HTML such as nav, button or header. It’s quite easy to see what these elements would be used for. These elements give more meaning to the content of a page, and we can use a combination of these elements and ARIA in our markup. However, there are a few things to keep in mind when using them together.
ARIA Roles
ARIA roles are added to HTML markup like an attribute. They define the type of element and suggest what purpose it serves. The following example identifies the element as some kind of banner:
[code language="html"]
<header role="banner">
[/code]
The following example, often placed in a containing element, suggests that its content provides some information about the content within the containing element:
[code language="html"]
<div role="contentinfo">
This website was built by Georgie.
</div>
[/code]
An alert would look like so:
[code language="html"]
<div role="alert">
Please upgrade to the latest version of your browser for the best experience.
</div>
[/code]
This one is my personal favorite, which is used when an element is simply for presentation. If you imagine someone using a screen reader, think of the elements that they would not want read out. One example is an element that might contain a visual decoration, or is an empty element simply serving an image or background color.
[code language="html"]
<span class="frame-corner" role="presentation"></span>
[/code]
ARIA Attributes
ARIA attributes are slightly different from roles. They are added to markup in the same way, but there is a range of ARIA attributes available for use. All ARIA attributes are prefixed with aria-. There are two types of attributes, states and properties.
- The value of states are bound to change as a result of user interaction.
- The value of properties is less likely to change.
An example of an ARIA attribute that is a state is aria-checked, which is used on the states of elements such as checkboxes and radio buttons.
[code language="html"]
<input type="radio" aria-checked="true">
[/code]
An example of an ARIA attribute that is a property is aria-label. This is used when a label for a form element is not visible on the page (perhaps because it makes no sense to make it visible, or if the design dictates this). For cases when label text is visible, aria-labelledby is the more appropriate attribute to use. Its use is as follows, with the attribute’s value matching the id value of the element it refers to.
[code language="html"]
<label id="address">Address</div>
<input type="text" aria-labelledby="address">
[/code]
This can also be done with the figure element.
[code language="html"]
<figure aria-labelledby="operahouse_1">
<img src="operahousesteps.jpg" alt="The Sydney Opera House">
<figcaption id="operahouse_1">We saw the opera <cite>Barber of Seville</cite> here!</figcaption>
</figure>
[/code]
You can read more about supported states and properties on the W3C website.
Rules of ARIA
Before you get too keen, remember that we don’t want to be adding ARIA to every element, for a couple of reasons.
Use Semantic HTML Elements Where Possible
Default implicit ARIA semantics refers to semantics that are already applied to an element by the browser. Elements such as nav, article and button have default implicit ARIA statements of role="navigation", role="article" and role="button" respectively. Before semantic HTML elements existed, it was common to have elements such as <div class="main-navigation" role="navigation">. Now we are able to use nav in place of div, but we no longer need to add role="navigation" because this is already implied. You can refer to this W3C table to check whether or not an ARIA attribute is required for a certain element.
Continue reading %How to Use ARIA Effectively with HTML5%
by Georgie Luhur via SitePoint
An Introvert’s Guide to Public Speaking
I’m an introvert.
I know, everybody says that. And every time I read it, I roll my eyes.
“You’re not really introverted, you with the public speaking, the podcasting, the 30 tweets per day. I’m introverted. I got scared to say yes in the school register and have deleted more tweets than I’ve posted purely out of shyness.”
That’s what rings in my head every time somebody mentions how introverted they are, and I expect something similar to be ringing through yours right now.
“You got scared to say yes in the school register? I didn’t even go to school I’m that introverted.”
I hear ya. Really, I do. It’s frustrating because it seems the more people say they’re introverted, the more it dilutes the challenges introverts face.
[author_more]
I actually think that all human beings are introverted in some way. It exists on a spectrum, with different factors triggering different worries.
There is one factor that everyone seems to face at one point in their lives. And that’s Public Speaking (yes, capitals. It sounds more scary with capitals).
I never thought I’d speak in public. But when Morena from State of the Browser contacted me to see if I’d like to submit a talk, I did it.
I wasn’t expecting the talk would get chosen.
And I certainly wasn’t expecting I’d actually go through with it.
But I did. And as with most experiences, I learned a few things on the way.
So here are five lessons I learned as an introvert speaking in front of an audience for the first time. You can apply these lessons for anything from a job interview to an investor’s pitch. Anywhere you’re trying to convince, inspire, teach or entertain.
Having an idea is just the first step. It’s getting it to spread that’s the hard part.
Lesson 1: Do Your Research First
When I started planning my talk, I knew the subject I wanted to speak about: pattern libraries. At the time, I had only just started working with them and I thought they were the best thing since the iPod. So naturally, I wanted to share this with the design community.
So I started writing.
I wrote a lot about how great they are and why we should be using them. It was only when I’d finished I started watching some talks other people have done on the subject.
The most recent one started like this:
“I think by now we’re all familiar with pattern libraries, so I won’t make you sit through another explanation of how great they are.”
…
She’d just described my whole talk.
It was only at that moment I realised everyone else has been working this way for a long time. It was only then, after 2 weeks of wasted work, I realised that I needed a different angle.
So research other talks on your subject first to make sure you’re not just repeating old information.
Research other pitches or your competitors and find out what they’re doing. Then do something different. Find a new angle and your audience will not only thank you, but they’ll remember you.
Be different. Be the purple cow in a field of brown cows.
Lesson 2: Write Out Your Talk
In the public speaking world you’re not meant to write your talk out word for word.
The way to do it is to write down bullet points and just let the rest flow. The idea is that you’ll sound natural, conversational and in the moment.
All great points of course and if you have the confidence more power to you.
I did not have the confidence. So I went against every piece of advice I’d both heard and read and I wrote my talk from scratch.
And boy, was I glad I did.
You see, I was already out of my comfort zone. Just the thought of what I’d agreed to do put me off my dinner (which is mighty hard to do!). I needed some form of safety net. Being over-the-top prepared was my safety net.
If you think writing out your presentation will help, just do it. If you’re going for a job interview, write out some answers to questions you may get asked.
It doesn’t mean you can’t go with the flow on the day. If you’re nervous about freezing up half way through, it’s a really good way to give you the confidence that, should the worst happen, you have something to fall back on.
Keep it a secret if you want. I won’t tell.
Continue reading %An Introvert’s Guide to Public Speaking%
by Laura Elizabeth via SitePoint