A Microsoft Evangelist’s Favorite Chrome Extensions

This article is part of a web development series from Microsoft. Thank you for supporting the partners who make SitePoint possible.

Chrome extension Applications list

Update: Lots of discussion going on about this on Reddit

Yes I’m a Microsoft Evangelist and in my day-to-day browsing, I use Chrome Canary. I want to see the latest and greatest emerging standards and experimental features. It will occasionally have display / graphical issues, so I’ll have to revert to standard Chrome, but after a few weeks the issues seem to be resolved. My main development machine is a late-2013 MacBook Pro. I’m on the road (AKA flying) constantly, and I need a strong laptop with discrete graphics, and also allows me to work on every mobile platform, so this does the trick.

On my Windows 10 machine, I use Microsoft Edge. It’s lightweight and incredibly fast, but still missing some features for me to make it my day-to-day browser as a web developer, but for browsing content I haven’t run into many issues – in fact, the JavaScript rendering is wicked fast. I do test all my web apps for Edge because Windows 10 is growing rather fast, 110+ devices. I tried installing Win 10 on my Mac, but the SSD was failing. Oddly enough, Windows 8 and 10 both detected it, but OS X didn’t. It wasn’t until I brought it into the Apple store and they ran their in-store diagnostics that it was picked up. Even the diagnostics tool built into OS X couldn’t detect it. Odd.

Considering most of my day is spent in the browser, I need extensions to help me get the most of my work. For that, I use a number of extensions in Chrome. Microsoft Edge has also announced support for JS-based extensions while removing legacy features like Active-X and conditional comments. Bear in mind, extensions can not only pose a security hazard, but also occasionally offer a ton of overhead, both in terms of CPU but especially RAM, as they all run as each tab in Chrome runs as its own process, and brings a separate instance of each extension. That means if I have 10 tabs open, and 10 extensions, then I can have some serious overhead!

Continue reading %A Microsoft Evangelist’s Favorite Chrome Extensions%


Source: Sitepoint

The Best Free WordPress Membership Plugins

WordPress is an incredibly versatile CMS. You can use it to launch a blog, an online store, a photo gallery and more. While it’s probably not its typical use, you can also easily turn WordPress into a membership site, too.

In order to run a membership site with WordPress, you need one of the numerous, free or paid, WordPress membership site plugins. You can’t say one plugin is better than the rest – it simply depends what you need it for. Here’s a roundup of the best free WordPress membership site plugins.

1. WP-Members

WP-Members

WP-Members is probably the first WordPress membership site plugin that comes to mind. This isn’t strange because it’s a very popular plugin – it has 60,000+ active installs.

The list of its features is rather impressive. In a nutshell, it has all the features you will need to manage your members and the content they can access. Some of the features you won’t find in all other plugins are inline login/registration (i.e. from the page itself, not from the WP login page), custom registration and profile fields, automatic creation of post excerpts, and so on.

Additionally, you can find a Quick Start guide and plenty of extensions to further enrich the functionality of the plugin.

Continue reading %The Best Free WordPress Membership Plugins%


Source: Sitepoint

Streamline Android Java Code with Kotlin

Released as an alternative to iOS, the first public version of Android was in 2008. It was Java based and supported Java 6, which at the time was the latest version. Two years passed and Java 8 arrived which brought cool new features including the Stream API, interfaces and the ability to use lambdas instead of SAM (Single Abstract Method).

Java 9 is on the horizon and Android developers are stuck using older versions of Java, meaning a lot of new features will be unavailable to them.

For Android developers there is now an alternative, Kotlin, a JVM language developed by JetBrains (the company behind IntelliJ and Android Studio). Like other JVM languages including Scala or Groovy, Kotlin is not officially supported by Android, but we can use it as a plugin. Building an application with a different JVM language will let you use new and different features than those available in Java 6.

Continue reading %Streamline Android Java Code with Kotlin%


Source: Sitepoint

Can You Use Photoshop to Tell a Story?

A sculpture at work

We are ‘creative types’. We like to make stuff.

That usually means starting with nothing – an empty page, a blank notepad, a sheet of paper – and slowing adding stuff to it. Typically we might add elements like:

  • Words
  • Colors
  • Shapes
  • Photos
  • Code

[author_more]

[/author_more]

But that’s not the only way to create something new. You can create by removing items. If you think about it, a sculptor’s great talent is just knowing exactly which bits of rock to throw away.

This approach can work really well with visual imagery too. Here are two of my favorite examples where ‘taking away’ parts of an image tells a new story.

WWF (World Wildlife Fund)

WWF - Photo with shark fin - photo without fin

(See full size)

WWF took a brave approach by choosing to avoid the usual cute and endearing pandas, lion cubs and seals pups commonly used in their ads.

If you can’t quite work out the text – I had to scale it down for this email – the first image with the shark fin is labelled:

‘Horrifying.’

The second image simply removes the shark fin and adds the label:

‘More horrifying.’

It’s impressive that they are able can create a sense of sadness by removing a shark. WWF used this theme with other animals including a vulture.

Continue reading %Can You Use Photoshop to Tell a Story?%


Source: Sitepoint

Build a Real-Time Photo Update App with the Instagram API

Instagram is an online photo sharing network that enables its users to take pictures and videos, and share them on a variety of social networking platforms. Users can personalize each photo that they upload (for example by adding various effects) and categorize them with a hashtag.

In this tutorial we’ll be building a real-time photo update app. This will allow users to enter a hashtag to which they would like to subscribe. Then, every time a new photo with that hashtag is posted to Instagram, it will be sent to our app which will display it accordingly.

We’ll implement our app in Node.js using Express as the framework. The real-time part will be implemented using Instagram’s Real-time Photo Updates and Socket.io. As ever, the code for this tutorial is available on our Github repo.

How the Real-time Photo Updates Work

[author_more]

Instagram’s Real-time Photo Updates work by sending notifications to your server every time a new photo is posted to the subscription that you selected. Here’s a break down:

  1. First, your server sends a subscription request to Instagram.
  2. Instagram receives the request and verifies that you really want to subscribe by sending back a response which your server has to send back.
  3. Your server receives the data and sends it back to Instagram.
  4. If the data is the same, Instagram will start sending notifications to your server.

There are four types of subscriptions from which you receive real-time updates : users, tags, locations and geographies. You can read more about each of these in the documentation. In this tutorial, we’re only going to use the tags subscription. This allows you to receive notifications when a new photo is tagged with whichever tags you specify.

Register an App

The first thing that we need to do is to create an Instagram account then register as a developer.

Next, we need to register a new Instagram app. You can put any valid URL for the website and Redirect URL as they are not needed for our app to function properly.

Screenshot of registering a new client to use the Instagram API

Once the app is created, take note of the CLIENT ID and CLIENT SECRET as they will be needed later when making requests to the Instagram API.

The Server-side setup

The next thing to do is clone the repo and install the dependencies using npm.

git clone git@github.com:sitepoint-editors/express-instagramrealtime.git
cd express-instagramrealtime
npm install

This will pull in the following dependencies:

  • Express is the de facto standard web application server framework for Node.js. It is used for serving the public-facing side of the app as well as receiving photo notifications from Instagram.
  • Express Handlebars is used for implementing views in Express.js.
  • body-parser is used for parsing the form data submitted by the user. In this case, the data is the tag that the user wants to subscribe to.
  • instagram-node-lib is a Node.js library for working with the Instagram API. Once we have the tag provided by the user, this library is used to subscribe to the tag.
  • socket.io — after subscribing to a specific tag, Instagram sends notifications to the server every time a new photo is posted with the tag that we used. This is where socket.io comes in. It is used for sending the photo data to the front-end every time a new notification is received by the server.
  • moment is used for formatting the timestamp provided by the Instagram API.

Now we’re ready to look at the app. In app.js we first need to require the dependencies we installed.

var express = require('express');
var exphbs  = require('express-handlebars');
var moment = require('moment');
var bodyParser = require('body-parser');
var instagram = require('instagram-node-lib');
var app = express();

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

// set the file name of the default layout
app.engine('handlebars', exphbs({defaultLayout: 'main'}));

// set the expressJS view engine to handlebars
app.set('view engine', 'handlebars');

// set the path to the front-end assets
app.use(express.static('public'));

Now, that we have required the necessary dependencies, we need to set the Instagram CLIENT ID and CLIENT SECRET. You will replace these values, with the values generated when you registered your app.

var instagram_client_id = 'YOUR-INSTAGRAM-CLIENT-ID';
var instagram_client_secret = 'YOUR-INSTAGRAM-CLIENT-SECRET';

instagram.set('client_id', instagram_client_id);
instagram.set('client_secret', instagram_client_secret);

Once we have our ID and Secret configured, the next thing we are going to do is create a server instance that will run on port 4000. You can check if the server has started running by using console.log to output the host and port.

var server = app.listen(4000, function(){
  var host = server.address().address
  var port = server.address().port

  console.log('Example app listening at http://%s:%s', host, port)
});

Next, have socket.io listen to the Express server. This binds socket.io to the same port as your Express server, so that later on you can use port 4000 when you connect to this socket on the client side.

var io = require('socket.io').listen(server);

Now let’s move on to creating a new route for the home page of the app. All it does is render the home template.

app.get('/', function(req, res){
  res.render('home');
});

Creating the Views

According to the default handlebars configuration, all view files should be stored in the views directory. The file home.handlebars will render the form controls into which the user will enter the hashtag that will be used for the real-time photo updates:

<div id="form-wrapper">
  <div class="form-group">
    <label for="tag" class="control-label">Hashtag</label>
    <input type="text" class="form-control input-lg" id="tag" name="tag" autofocus>
  </div>

  <div class="form-group">
    <button id="start" class="btn btn-lg btn-block btn-primary">Start</button>
  </div>
</div>

<div id="results" class="hidden">
  <div class="row"></div>
</div>

Every time a new photo which has that hashtag is posted by any Instagram user, it will be immediately displayed by the app inside the div with the id of results.

Earlier on the app.js file, we set the file name for the default layout with the following code:

app.engine('handlebars', exphbs({defaultLayout: 'main'}));

In handlebars, layout files are stored in the views/layouts. In this directory the file main.handlebars serves as the main layout. The main content is rendered inside the div with the id of wrapper:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Real-time Photo Updates</title>

    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/style.css">
  </head>
  <body>
    <div id="wrapper">
    {{{body}}}
    </div>
    <script src="https//instagram.com/js/jquery.min.js"></script>
    <script src="https//instagram.com/js/jquery.backstretch.min.js"></script>
    <script src="https//instagram.com/js/jquery.imagepreload.min.js"></script>
    <script src="https//instagram.com/js/vague.min.js"></script>
    <script src="https//instagram.com/js/socket.io.min.js"></script>
    <script src="https//instagram.com/js/handlebars.min.js"></script>
    <script src="https//instagram.com/js/moment.min.js"></script>
    <script src="https//instagram.com/js/livestamp.min.js"></script>
    <script src="https//instagram.com/js/script.js"></script>
  </body>
</html>

As you can see, a few front-end dependencies are required. Here’s a brief description of each:

  • Bootstrap is a front-end framework. This is my personal choice for almost every web thing that I build. If you also want to use Bootstrap, you can find free themes at bootswatch.com.
  • jQuery is used for manipulating HTML and listening for click events on the page. It’s also the dependency of the 3 libraries below.
  • jQuery BackStretch is used for making the current photo into a full page background image.
  • The jQuery Image Preload plugin is used for preloading the image before showing it to the user.
  • Livestamp helps keep the timeago text current when no new photo is received from the server side for too long.
  • Vague.js applies a blur filter to the background image.
  • handlebars is used for generating the HTML to be used for displaying photos.
  • moment is used for displaying timeago text based on the timestamp.

These dependencies can be found in public/js and public/css. This is because we specified that this folder (public) should contain our front-end assets:

app.use(express.static('public'));

You could also use bower to download and manage these assets. If you so chose, be sure to update the .bowerrc file so that it uses the static directory that you specified.

With that out of the way, we’re now ready to create the script.js file.

Continue reading %Build a Real-Time Photo Update App with the Instagram API%


Source: Sitepoint

How to Use Pebble’s New Dictation API

Earlier this month, Pebble released version 3.6 of their SDK. My eyes widened when I discovered it included access to their Dictation API. This API gives all Pebble developers access to dictation from the Pebble Time microphone. I eagerly opened up the CloudPebble editor and began experimenting!

In this article, we’ll explore the Dictation API by putting together a watchapp that accepts a dictated message and sends it to a Slack channel via IFTTT.

What You’ll Need

In order to step through this guide, you’ll need the following:

[author_more]

The Code

There are developers out there who prefer to jump straight into the code. If you are that type of developer, all the code is available on GitHub.

Our watchapp will have two main files:

  • main.c – Our C code manages the dictation, the display of instructions and display of the entered message.
  • pebble-js-app.js – This manages our communication to IFTTT.

IFTTT

I’d recommend setting up your IFTTT Maker channel and Slack rule first, just so the code set up we’ll do after this makes more sense.

I’ve previously covered IFTTT in the articles Connecting LIFX Light Bulbs to the IoT Using IFTTT and Connecting the IoT and Node.js to IFTTT (this second one covers the Maker channel). So if you’d like a more in depth explanation of using IFTTT and the Maker channel, have a read through of those.

Here’s a very quick runthrough of what you’ll need to set up:

  • Create an IFTTT account if you haven’t already got one.
  • Connect the Maker Channel and Slack Channel to your account.
  • Create a new recipe with the Maker channel as the trigger.
  • Choose the “Receive a web request” trigger option and name the event “slack_message”.
  • Choose the Slack channel to be the action channel for this IFTTT rule and choose the “Post to channel” action.
  • Select the Slack channel you’d like the message to go to and set the message to only contain {{Value1}}.
  • You can remove the title, or choose something like “Pebble Message Received”. I left it blank. I also left the thumbnail URL blank too.
  • Create your action and you should be ready to go! IFTTT is ready to send any messages it receives from that event to the Slack channel you specified.

Our C Code

The main.c file looks like so:

[code language=”c”]
#include <pebble.h>

static Window *s_main_window;
static TextLayer *message_layer;

static DictationSession *s_dictation_session;
static char display_message[512];

static void handle_message(char *slack_message) {
DictionaryIterator *iter;
app_message_outbox_begin(&iter);

dict_write_cstring(iter, 0, slack_message);

app_message_outbox_send();
}

static void dictation_session_callback(DictationSession *session, DictationSessionStatus status, char *transcription, void *context) {
if(status == DictationSessionStatusSuccess) {
snprintf(display_message, sizeof(display_message), “Message sent!nn”%s””, transcription);
text_layer_set_text(message_layer, display_message);
handle_message(transcription);
} else {
static char error_message[128];
snprintf(error_message, sizeof(error_message), “Error code:n%d”, (int)status);
text_layer_set_text(message_layer, error_message);
}
}

static void select_click_handler(ClickRecognizerRef recognizer, void *context) {
dictation_session_start(s_dictation_session);
}

static void click_config_provider(void *context) {
window_single_click_subscribe(BUTTON_ID_SELECT, select_click_handler);
}

static void window_load(Window *window) {
Layer *window_layer = window_get_root_layer(window);
GRect bounds = layer_get_bounds(window_layer);

message_layer = text_layer_create(GRect(bounds.origin.x, (bounds.size.h – 72) / 2, bounds.size.w, bounds.size.h));
text_layer_set_text(message_layer, “Press select and tell me your Slack message :)”);
text_layer_set_text_alignment(message_layer, GTextAlignmentCenter);
text_layer_set_font(message_layer, fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD));
layer_add_child(window_layer, text_layer_get_layer(message_layer));
}

static void window_unload(Window *window) {
text_layer_destroy(message_layer);
}

static void init() {
s_main_window = window_create();
window_set_click_config_provider(s_main_window, click_config_provider);
window_set_window_handlers(s_main_window, (WindowHandlers) {
.load = window_load,
.unload = window_unload,
});
window_stack_push(s_main_window, true);

app_message_open(app_message_inbox_size_maximum(), app_message_outbox_size_maximum());

s_dictation_session = dictation_session_create(sizeof(display_message), dictation_session_callback, NULL);
}

static void deinit() {
dictation_session_destroy(s_dictation_session);

window_destroy(s_main_window);
}

int main() {
init();
app_event_loop();
deinit();
}
[/code]

Our Dictation Calls

The first bit of code Pebble developers will notice is new is the line which sets up a DictationSession. This is what we store our transcription data and other data related to the Dictation API within:

[code language=”c”]
static DictationSession *s_dictation_session;
[/code]

Next, we define a simple char array to store our latest successfully transcribed message:

[code language=”c”]
static char display_message[512];
[/code]

Within our init() function, we set up the actual dictation session so that it is ready and waiting for us to request it. It is set to provide space to store our dictated message that matches the length of display_message. It also sets the callback function once we’ve performed dictation to be dictation_session_callback().

[code language=”c”]
s_dictation_session = dictation_session_create(sizeof(display_message), dictation_session_callback, NULL);
[/code]

Running Dictation on Click

We want to set up our dictation to run when the user clicks the select button on their Pebble. We set click functionality via window_set_click_config_provider().

[code language=”c”]
window_set_click_config_provider(s_main_window, click_config_provider);
[/code]

That tells our Pebble that our click functions are defined within click_config_provider(). Within that, we initialize the process of dictation via a press of the select button (defined as BUTTON_ID_SELECT in Pebble’s SDK). This button action is set up via window_single_click_subscribe() function.

[code language=”c”]
static void click_config_provider(void *context) {
window_single_click_subscribe(BUTTON_ID_SELECT, select_click_handler);
}
[/code]

Continue reading %How to Use Pebble’s New Dictation API%


Source: Sitepoint

Managing Cronjobs with Laravel

There are times when your application needs to run administrative tasks periodically on the server. Whether you want to send out emails to your users or clean up the database tables at the end of the day, you will need a task scheduling mechanism to take care of the tasks, when it’s time.

Cron is a task scheduler software in unix-like systems, which runs shell commands at certain intervals. This article is not meant for introducing Cron, but since it is a key concept in our discussion, we’ll will describe how it works in short.

A clock

Cron basics

Cron is a task scheduler daemon which runs scheduled tasks at certain intervals. Cron uses a configuration file called crontab, also known as cron table, to manage the scheduling process.

Crontab contains cronjobs, each related to a specific task. Cron jobs are composed of two parts, the cron expression, and a shell command to be run:

* * * * * command/to/run

Each field in the above expression (* * * * *) is an option for setting the schedule frequency. It is composed of minute, hour, day of month, month and day of week in order of the placement. The asterisk symbol refers to all possible values for the respective field. As a result, the above cron job will be run every minute in the day.

The following cron job is executed at 12:30 every day:

30 12 * * * command/to/run

This is just the tip of the Cron iceberg; to learn more about it, you might want to visit the wikipedia page.

In PHP powered applications, administrative tasks are normally standalone PHP scripts which are run in CLI mode. These scripts are written for performing different jobs at certain times.

However, we can’t do much without the power of other PHP libraries and frameworks. In this article, you will learn how to use the Laravel framework to create robust PHP scripts for the command line and schedule them right from the source code.

Creating Commands in Laravel

Creating a command in PHP is as simple as creating a PHP script, then running it in the command line, using the php command:

php somefile.php

As you can see, the file is passed as an argument to the command php.

Whether your application has been developed in Laravel, or you just want to use its facades and helpers to create your scripts, you will need to bootstrap Laravel before using it. However, there’s a better alternative to this: creating a Laravel Artisan command.

When using Artisan commands, we will have access to all features of Laravel, including helpers, facades, and other Artisan commands, just to name a few.

We’re not going to go into the details of Artisan commands here, as they’re beyond the scope of this tutorial, but let’s discuss the basics, just to get started. We’ll will be using the latest version of Laravel, which is 5.1 at the time of writing this article.

We use the make:console Artisan command to generate a command class skeleton to work with. As an example, we’re going to create a command which sends a happy birthday SMS message to our users on their birthday.

Continue reading %Managing Cronjobs with Laravel%


Source: Sitepoint

How to Build an AR Android App with Vuforia and Unity

Virtual and Augmented Reality has been getting a lot of attention lately. Lots of really cool Head Mounted Devices (HMDs) like Oculus, Hololens, HTC Vive, FOVE, and Magic Leap have been coming up. The simplest and cheapest of all these HMDs is Google Cardboard, and it already has more than a million users worldwide.

Google Cardboard

Patrick has covered Building Google Cardboard VR Apps in Unity in his recent post. In the following two tutorials, we will be developing a basic Android Augmented Reality application for Google Cardboard using Unity3D. We will be using Qualcomm’s Augmented Reality SDK named “Vuforia” to make this app.

The following software and the corresponding versions will be used in the following two posts:

  • Vuforia 5
  • Unity 3D 5.x
  • Cardboard SDK version 0.5.x (needed for next tutorial)
  • Android Studio and SDK tools (these need to be installed and set up for Unity builds to work. More information about this can be found in the “Integrating with Unity” section.)

Brief Overview

There are several approaches to making Augmented Reality apps. We will be using a marker based approach for making our AR app for mobile devices. In the next tutorial, we will be adding cardboard support.

Marker/Image Target – this is an image which is recognized and tracked by a mobile device’s camera. This acts as an origin for augmentation. Once recognized, content can be displayed with respect to it.

This tutorial will broadly have three parts:

  1. Getting Started with Vuforia
  2. Integrating with Unity
  3. Demo (Fun part)

Continue reading %How to Build an AR Android App with Vuforia and Unity%


Source: Sitepoint

4 Expert Tips for Getting the Most Out of Google Fonts

Google fonts has been with us for almost five years now. If you work with web front-ends, there is every chance that you have used the service in at least one of the websites that you developed.

While the licensing costs have remained zero, the font library has steadily grown in both number and quality, with Google handling both the copyright and infrastructure issues at once. What’s more, implementing Google fonts requires minimal work on your part as Google’s magic servers handle many of the trickier issues we used to have to manage ourselves.

We probably take it for granted, but it’s easy to forget how difficult, hacky and expensive it used to be to use custom typography on your site. Read up on ‘sIFR‘ if you want a quick reminder of what we used to go through.

Having access to such a useful resource, it makes sense to get the most out of it. In this article, I’d like to discuss four tips that you can follow to use Google fonts like a pro.

Tip #1: Request Multiple Fonts in a Single Request

Using different fonts in heading and paragraph text can often improve readability. However, we also know that requesting many small files from a server is significantly slower that requesting one large file.

So, instead of requesting each font separately, it’s advantageous to combine those multiple font requests into one. As an example, let’s say you wish to load two fonts — Lato and Raleway. The proper way to load the fonts would be:

<link href='https://fonts.googleapis.com/css?family=Lato|Raleway' rel='stylesheet' type='text/css'>

Though this does not reduce the total bits requested, the number of HTTP requests is reduced, which can significantly improve page load time. The more fonts you have, the bigger the saving – though there are good aesthetic reasons for limiting the number you use.

Additionally, the code is more concise and readable. You only need to look at one line to understand all the fonts that your webpage is requesting.

Specifying Font Styles and Script Subsets

There are times when you may want the italic or bold version of a font. In situations like these you can specify the font style using i and b respectively after the font name separated by a :. Here is an example:

<link href='https://fonts.googleapis.com/css?family=Lato:i|Raleway:b' rel='stylesheet' type='text/css'>

You can also use bi to load a bold italic font style if available.

If you want a different variation of a bold font you can use a numerical weight. Raleway, for example, has four versions of bold with weight 600,700,800 and 900. To request the ultra bold font you need to write:

<link href='https://fonts.googleapis.com/css?family=Raleway:900' rel='stylesheet' type='text/css'>

If you are not comfortable with the abbreviations you can also specify the full name for a font style, as I’ve done in the next example:

<link href='https://fonts.googleapis.com/css?family=Lato:300italic' rel='stylesheet' type='text/css'>

In this case, instead of loading a normal italic font, we are loading the light version.

Some fonts in the directory support multiple scripts like Latin and Greek. One example of such a font is Roboto Mono. To request the Greek subset of the font you can use the following URL:

<link href='https://fonts.googleapis.com/css?family=Roboto+Mono&subset=greek' rel='stylesheet' type='text/css'>

Optimizations

In specific situations, you might need to use only a strictly limited set of characters from a given font. This may also be the case when you only require the digits from a given font.

In cases like this, it’s simple to reduce the request size by cherry-picking the specific characters we need by using thetext= value in your font URL. This way Google will return the version of the font file you requested optimized for your specific needs. This can dramatically reduce the file-size of the font that is supplied.

Consider the following example:

<link href='https://fonts.googleapis.com/css?family=Raleway&text=SitePoint' rel='stylesheet' type='text/css'>

Instead of loading the complete Raleway font file, we only load the characters we need for ‘SitePoint’. This reduces the request size and, as a result, the webpage loads a little more quickly. These optimizations can add up and have a significant impact on the overall load time of a webpage. Keep in mind that you need to URL-encode the value of text.

Continue reading %4 Expert Tips for Getting the Most Out of Google Fonts%


Source: Sitepoint

What’s in Your Wallet? Handling iOS Passbook with Ruby

Passbook (called “Wallet” starting in iOS 9) is an built-in iOS application that provides a way for users to store and access “passes”. Consider a pass as a digital token for something, such as event tickets, membership cards, discount coupons, boarding passes, etc. Passes can be added to passbook by mail, messages, an app, etc.

A pass has many benefits for the user. For example, say a user has added a pass for a movie ticket that starts at 10.00 A.M.. That pass will be displayed on the home screen when the even draws near the user to access it directly. If a membership pass with some discount for Store X has been added, it would be displayed whenever the user walks in to Store X.

Passes are also beneficial to pass providers. For one, a pass can be used as a means of notification whenever there is some change regarding the information. Examples are a movie is canceled or boarding pass is changed, or the providers wants to give an extra discount for pass holders. All of this is possible with the use of passes.

Today, we’re going to see how to build an iOS passbook backend that handles pass generation and push notifications. I am going to use Ruby and Sinatra for it. Let’s get started.

Continue reading %What’s in Your Wallet? Handling iOS Passbook with Ruby%


Source: Sitepoint