Javascript News

Syndicate content
Pipes Output
Updated: 4 min 23 sec ago

jQuery Foundation adopts Esprima

Mo, 2015-01-26 20:08

The jQuery Foundation is excited to announce that we are now hosting the Esprima project! The Abstract Syntax Tree generated by this JavaScript parser is used by many important developer tools such as ESLint, Istanbul, JSDoc and JSCS.

Ariya Hidayat has decided to transfer ownership of the Esprima project and its repo to the jQuery Foundation. We’re glad that Ariya has taken this step, since Esprima is such an important part of so many projects and is downloaded more than 2.5 million times every month from npm. Many thanks to Ariya for entrusting this project to us.

The adoption of the Esprima project, following the recent adoption of the Pointer Events polyfill, are the initial steps in a big shift toward realizing our mission to improve the open web and make it accessible to everyone. The jQuery Foundation looks to ensure that other important tools and emerging standards are also given the chance to grow and shape the open web.

The jQuery Foundation is committed to providing support to Esprima and opening it up for contributions. If you’ve been a contributor to this project already, we want you to continue that work and are always open to new contributors. Please stay tuned, we’ll be making more announcements soon.

Video: Create Amazing Applications with Google Maps

Mo, 2015-01-26 20:00

You'll see Google Maps being used as a feature almost anywhere you look these days. If you're checking out a new restaurant's website, or the contact page of your local grocery store, chances are you'll find the Google Maps API hard at work.

In this video I will explore the benefits and capabilities of Google Maps, and show you how other websites have customized the Google Maps API to make it a more attractive, interactive and informative map.

Continue reading %Video: Create Amazing Applications with Google Maps%

Screencast: Understanding HTML Versions

Mo, 2015-01-26 19:00

Do you know the differences between HTML4, XHTML, and HTML5? In this screencast Guilherme will run you through earlier versions of HTML and show you some examples along the way. By the end of this video, you'll understand the evolution of HTML to its current version, HTML5. [youtube mE-GzOtpFgc] This is just one lesson taken from Guilherme's latest course: Introduction to HTML which you can find on Learnable.

Continue reading %Screencast: Understanding HTML Versions%

WordPress Plugins for Successful Content Marketing

Mo, 2015-01-26 18:00

With the rise and rise of content marketing expected to reach new heights in 2015, marketers are more likely than ever to use WordPress as an integral content marketing tool this year. If you don’t believe me, then take a gander at some of these stats:

  • Content marketing is used regularly by 93% of marketers
  • 57% of marketers cite content marketing as their number one priority
  • 76% of B2B marketers blog regularly (a large percentage of which probably operate using WordPress)
  • Best of all, the price tag associated with content marketing is 62% less than traditional marketing tactics, and generates three times as many leads.

With this burgeoning use of WordPress for content marketing, it should come as no surprise that there is a whole gamut of plugins for successful content marketing to help your program run more smoothly and deliver greater return on investment.

WordPress Plugins for Content Marketing Strategy, Planning & Organisation

One of the most important tenants of any successful content marketing strategy is consistency. High quality, engaging or educational content must be produced and disseminated regularly, and for the long-term, for content marketing to deliver any substantial return on investment. That makes plugins designed to streamline scheduling and organisation one of the most important aspects of any WordPress powered content marketing program.


Developed by Copyblogger Media, Scribe is the veritable ‘Big Daddy’ of all WordPress plugins for content marketing. Using Scribe you can undertake in-depth research into content marketing opportunities as well as social media leads and traffic. It allows you to align your writing style with your content marketing program objectives, so that you can make sure all on-page content is optimised for the search engines. You can even use it to pinpoint similar social media profiles and websites. The plugin follows a simple formula for successful content marketing: research, optimise, connect. There are a couple of limitations on Scribe: your website must be running a compatible theme, and it will only analyse English. More than 83,000 content marketers have downloaded the plugin, which seems to be regularly updated.

Continue reading %WordPress Plugins for Successful Content Marketing%

Basic TDD in Your New PHP Package

Mo, 2015-01-26 17:00

In part 1, we set up our development environment, baked in some rules as inherited from The League, and created two sample but useless classes - Diffbot and DiffbotException. In this part, we’ll get started with Test Driven Development.

If you’d like to follow along, please read Part 1 or clone the part 1 branch of this tutorial’s code.


We’ve covered PHPUnit to some degree before (1, 2, 3, 4, 5, 6), but it’s time we put it into real practice now. First, let’s check if it’s installed.

php vendor/phpunit/phpunit/phpunit

Running this command should produce a report that says one test passed. This is the test included in the League Skeleton by default and it asserts that true is, in fact, true. A coverage report will also be generated and placed into the build folder.

Continue reading %Basic TDD in Your New PHP Package%

Closures in Ruby

Mo, 2015-01-26 15:00

Some time ago, as a dyed-in-the-wool C++ programmer who was exploring the mysterious world of Ruby, I got enthralled by the concept of closures and the way the language handled them. I was already familiar with the concept of closures from my JavaScript experience, but the manner in which Ruby handles closures both perplexed and fascinated me. Years later, I decided to write an article about them and here it is.

What's a Closure?

A closure is basically a function that:

  1. Can be treated like a variable, i.e. assigned to another variable, passed as a method aument, etc.
  2. Remembers the values of all the variables that were in scope when the function was defined and is able to access these variables even if it is executed in a different scope.

Put differently, a closure is a first-class function that has lexical scope.

Continue reading %Closures in Ruby%

5 Mistakes Job Candidates Make

Fr, 2015-01-23 20:00

A few days ago I published an article titled 5 Mistakes Job Interviewers Make where I discussed interviewers can get it wrong and potentially miss a great candidate. Interviewers aren’t the only people who make mistakes during the interview process and often the candidate does or doesn’t do something that pushes the decision of the interviewer in the wrong direction.

In this article I’ll cover 5 mistakes that you, as the candidate of a job interview, should avoid in order to leave a good impression and give yourself the best chance of success.

1. Don’t Be Late

First thing first: don’t be late for the interview. I know this advice may sound trivial and something that you already know, but it still happens. You can never predict what might make you late. It could be public transport problems or flash flooding. But most of the time if you arrive late is because you didn’t plan properly.

Running late not only suggests poor time management skills, but shows a lack of respect for the company. Arriving late is an excellent way to give your interviewer a bad first impression and we all know how important first impressions are.

So, plan your journey as well as possible, even by checking the public transport website the night before if you have to. Jump on Google and figure out exactly where your interview is and make note of a couple of reference points so that you don’t get flustered if you get lost. Budget your time so that you make it to the interview at least 10-15 minutes early.

While it’s good to arrive early, don’t get there 3 hours early or you’ll come across as nervous and well, a bit weird.

Continue reading %5 Mistakes Job Candidates Make%

How Fast Food Packaging Influenced Mobile Virtual Reality

Fr, 2015-01-23 19:30

One year ago, my two oldest Berlin friends, Tom Kubischik and Nayden Naydenov contacted me. Nayden had claimed to make Virtual Reality possible on smartphones.

Tom and Nayden both work in the gaming industry, Tom as a large-scale project-manager for “Morgen Studios” and Nayden as a genius developer.

In the 90s I was working in the VR department of the Fraunhofer Institute IPK in Berlin. One of the biggest problems in Virtual Realty in those days was the huge and expensive setup you needed to show your work. I think this was the reason Virtual Reality never had the Impact it could have had in its early years. For me it was the motivation to concentrate more on other fields of design in the following years.

Back to the invention. Nayden had conceived a 3D printed box with two lenses in which you could insert a smartphone, thus converting it into a head-mounted-display (HMD) and enabling you to dive into virtual realty. A real-time animation split side by side into two screens was visible on the display, giving the impression of sitting in a roller coaster, racing along the track.

It was a phenomenal experience, standing in a room and having the impression of being in the scene, cable-less and with only the help of a regular phone.

The possibility of Virtual Reality on a smartphone was an immediate game-changer for me, I was hooked again.

Continue reading %How Fast Food Packaging Influenced Mobile Virtual Reality%

An Introduction to Asset Handling in WordPress

Fr, 2015-01-23 18:45

As a WordPress theme or plugin developer, there will come a time during your development process that you will need to include third party scripts or stylesheets in your plugin or theme. Sure, simply linking the assets in the header or footer would definitely work, but adhering to standard practice using the provided WordPress API will ensure that your theme or plugin will play nice with other plugins in the WordPress ecosystem.

If you want to provide maximum compatibility with other plugins and themes available, asset handling in WordPress is definitely a skill you should master.

This article is targeted to the beginner WordPress developer, with the assumption that you have a working knowledge of how WordPress action and filter hooks work.

The Basics

WordPress has provided a few basic functions to help the developer correctly load custom assets of their theme or plugin. The four main functions that you will use frequently are wp_register_script, wp_enqueue_script, wp_register_style and wp_enqueue_style.

Let's go through these four major functions one by one.

Continue reading %An Introduction to Asset Handling in WordPress%

On Our Radar This Week: Monolithic Frameworks and Firefox OS

Fr, 2015-01-23 18:00

Welcome to On Our Radar, a weekly round-up of news, trends and other cool stuff from the world of web development.

This week, Microsoft's relations with Google continued to deteriorate, as Google's Security team disclosed three new bugs in Windows before Microsoft was able to patch them. Microsoft had already criticized Google claiming that the search giant's behavior needlessly endangers customers, while in a bizarre turn of events, it was announced that Google won't fix a bug affecting 60 percent of Android phones.

Elsewhere, a service that anonymously delivers an envelope chock-full of glitter to someone you hate (or, to someone who really likes glitter), was making headlines. As the site went viral, the 22-year-old entrepreneur behind the scheme begged people to stop using it. He then cashed in his chips and put the site up for sale on Flippa.

And finally Mark Zuckerberg entered the office with the launch of the 'Facebook At Work' pilot, meaning that the social network responsible for sucking up hours of your working day may soon be one of your company's critical productivity tools.

Frameworks - Where Do You Stand?

I've been on the fence about JavaScript frameworks for a while now, so it was with some interest that I read an opinion piece by Peter-Paul Koch (of QuirksMode fame) citing the problem with AngularJS. The article generated quite a lot of debate in a comment thread on Hacker News, which is also worth checking out.

Continue reading %On Our Radar This Week: Monolithic Frameworks and Firefox OS%

How to Build an OctoberCMS Widget Plugin

Fr, 2015-01-23 17:00

In a previous article we talked about the basics of creating an OctoberCMS plugin. In this one, we’re going to go deeper, and we’ll explore how we can extend the OctoberCMS backend using widgets.

What We Are Going To Build

I will assume that many of you have used Wordpress. On the dashboard, we have a quick draft widget. In this article, we’re going to see how we can build a similar one for OctoberCMS.

Plugin Registration

To start building our plugin, we’ll use a command utility for scaffolding.

php artisan create:plugin RAFIE.quicknote

The command will create a Plugin.php file and an updates folder containing the version.yaml file.

public function pluginDetails(){ return [ 'name' => 'Quick Note Widget', 'description' => 'Add and manage some drafts when you\'re in a hurry.', 'author' => 'RAFIE Younes', 'icon' => 'icon-pencil' ]; }

After registering our plugin we need to update our version.yaml file.

// uploads/version.yaml 1.0.1: First version of quicknote 1.0.2: - Created Notes Table - create_notes_table.php

Continue reading %How to Build an OctoberCMS Widget Plugin%

3 Common UX Gaffes and Ways Around Them

Fr, 2015-01-23 05:25

A while back, I tried to sign up for Venmo, a service that promises to simplify online payments between individuals. I say tried because it turned out Venmo was US-only. This limitation, however, revealed some critical UX flaws I’ve seen in other websites before. All three flaws I’ll discuss in this post are incredibly easy to fix, and as such I’m often surprised at how long some companies take to fix them. Let’s go through them one by one.

Note that while I will be using Venmo as a case study in this post, they're not alone in making these slip-ups — these issues apply to a wide range of other websites and services too.

Continue reading %3 Common UX Gaffes and Ways Around Them%

Creating an Anti AdBlock Plugin for WordPress

Do, 2015-01-22 20:30

In this tutorial, we will create a WordPress plugin that can disable the website for users using AdBlock or display alternative ads to AdBlock users from the same domain as the website.

This plugin can be useful if your website is completely dependent on ads for generating revenue and where users consume a high amount of resources. For example, a video sharing site may want to ban a site from playing videos or display alternative ads for AdBlock installed users. One such example is, as shown above. You can see requests you to unblock ads for their site.

How Does AdBlock Work?

AdBlock maintains a list of various advertising network domain names and a list of advertising specific keywords.

AdBlock works by blocking image, iframe, script and Flash HTTP requests that match known advertiser domain or advertiser specific keywords that are on their list. After the requests are blocked, it also changes the CSS properties of the blocked HTHML elements to hide them.

AdBlock allows you to expand on what can be blocked by adding filters.

Continue reading %Creating an Anti AdBlock Plugin for WordPress%

Create a Tetromino Puzzle Game Using Swift – Gameplay

Do, 2015-01-22 19:30

With only the simplest of mechanics, our game will be able to offer engaging gameplay with high replay value. Looking at the game animation in the Introduction once again, we can easily identify most of these rules. The most obvious of which include the rules on falling, movement and collisions. We also have rules on clearing lines, scoring and levelling up. Let’s implement all of them now starting with the falling rule.

Dropping Tetrominoes

Our game’s world utilizes its own unique gravity. It is significantly different from the typical gravity simulation in other games which produces a smooth, accelerating falling effect. In our game, tetrominoes fall one row at a time with constant speed which increases only when the level increases. This means we can’t rely on SpriteKit’s default physics engine to simulate gravity for us so we have to manually control and time every tetromino drop.

Continue reading %Create a Tetromino Puzzle Game Using Swift – Gameplay%

How to Teach Yourself Web Development

Do, 2015-01-22 18:30

At the age of twelve, after discovering the “Save as Web Page” option in Microsoft Word, I started to teach myself web development. I learned HTML first, of course, and then CSS and JavaScript, and then bits and pieces of PHP and Rails. (These days, I’m quite fond of Meteor.)

Over the years that followed, I considered getting a formal education, and I could see the value in doing so, but in the end:

  1. It was too expensive.
  2. I struggled with learning in a classroom setting.
  3. I was already making comfortably progress.

But it’s not like this was always an effortless process. I wasn’t just learning how to write code for the web, after all. I was also learning how to learn, and that’s what we’re about to discuss.

Here are five steps for teaching yourself web development.

1. Pick an area of web development that excites you.

You can’t just “become a web developer” by reading a certain book or watching a certain number of videos. Web development is a big field and trying to be a jack-of-all-trades will likely leave you exhausted, frustrated, and only a little further ahead than when you first started.

Being a web developer is like being a scientists. There are foundational ideas that apply across disciplines but, ultimately, you need to specialize. You have to commit to something forever though — it’s easier to move to another area once you’ve mastered one — nor will you be limited by your choice. Someone who is intricately familiar with PHP can do a lot more than someone with a basic grasp of ten cutting-edge web technologies.

But at this point, there’s no right answer. As long as you have a grasp of HTML and CSS, you simply need to pick whatever seems interesting. Perhaps discover what your favorite websites are built with. You’ll find that Rails is all over the place but JavaScript frameworks are on the rise. I’m working with Meteor because I like its real-time features. Your reasons, however, don’t precisely matter. Just try to follow your own interests, since that’s the only way you’ll be able to maintain your motivation.

Continue reading %How to Teach Yourself Web Development%

The Ultimate Long-shadow Sass Mixin

Do, 2015-01-22 18:00

You know the long shadow design trend, right? Although, I'm not even sure this is a trend anymore, everything moves so fast... Anyway, long shadows used to be and / or still are a trendy design trick to give some emphasis to some text or an element.

There is no easy way to create a long shadow in CSS. At the end of the day, either you use some image-based format (an actual image, SVG...) or you rely on text-shadow and box-shadow. The latter options are better because they are nothing but CSS that can be handled very nicely by the browser.

The Problem is: that it is a pain to write. To achieve a clean long shadow effect, you have to build a chain upwards of 50 shadows or so, slightly shifting values one step at a time, possibly the color as well... Completely impractical. This is typically the kind of thing you want to automate with Sass or whatever tool floats your boat.

Indeed, there have been many attempts at making a long shadow mixin. Among the solutions I have seen, I have noticed problems, including:

  • no way to define the direction;
  • no way to define the number of shadows;
  • only works for text-shadow;
  • overly complicated.

Well fasten your seatbelt folks because I have found what I dare to call a clean solution. I have built a ~15 lines long property-agnostic long-shadow function that accepts a direction (as well as a few other arguments).


Because we want our tool to work with both box-shadow and text-shadow properties, we will not actually build a mixin like the title of the article says, but actually a function. Then, you'll be able to use it like this:

Continue reading %The Ultimate Long-shadow Sass Mixin%

Other Ways to Make Money as a Freelancer

Do, 2015-01-22 17:00

Starting out in business on your own is an exciting time, but what nobody really tells you is just how difficult it can be to make money without working yourself into a shadow. Add that to the fact that essentially, every time you gain a new project you have a new boss that you have to find different ways to get on with and freelancing can soon look like a worse option than the general 9-5.

In fact, there are many things that can get you down when you’re a freelancer. You realize that you have to have business skills, you need to get involved with the tax man on a more intimate basis than you’d like and you need to price jobs in such a way that you both beat the competition, and are able to eat. This can all get very wearing and suddenly, it can seem that the daily grind of working for somebody else wasn’t actually much of a grind at all when you’re putting in 16 hour days.

However, there are ways in which you can supplement your income so that perhaps you don’t have to work quite so hard just to live. You’re unlikely to get rich from these income streams, but you were equally unlikely to become a millionaire by adhering to the hourly billing model either. So in other words, you have nothing to lose by checking out other ways of making money and with that in mind, let’s have a look at your options.

Continue reading %Other Ways to Make Money as a Freelancer%

Rails URL Helpers in Javascript with JsRoutes

Do, 2015-01-22 15:00

p>When we use resource routing in Rails (paths like "/blogs/new" or "/blogs/2/edit"), we often use path variables such as new_blogs_path. But, when when working in Javascript, we have to hardcode the the paths, i.e. "/blog/new". In this article, we'll cover JsRoutes, an awesome gem that lets us use a similar set of URL helpers in our Javascript code. Why do we need JsRoutes?

The idea is that you should not have to construct URLs manually in Javascript if a library can do it for you! This becomes evident as soon as you start doing nested routes. For example, consider the following routing configuration:

[ruby] resources :posts do resources :comments end [/ruby]

If we want the path to edit the comment with an ID of 4 that is associated with the post with an ID of 1, it gives "/posts/1/comments/4/edit", which is a mouthful. It is much easier to use the URL helpers supplied by Rails than construct that string in our Javascript.

Continue reading %Rails URL Helpers in Javascript with JsRoutes%

5 Mobile App Testing Tools

Mi, 2015-01-21 19:30

As an app developer you need to ensure that your app works and that there are as few issues as possible on release. There are many testing tools available that help distribute beta versions and invite users to give feedback and report problems.

With app testing tools you can generally collect crash reports, analytics, feedback and more. In this article I will list some of the free and paid options that will help you to publish better apps.

Some tools are only for iOS and others are cross platform.

Continue reading %5 Mobile App Testing Tools%

jQuery UK: Europe’s jQuery Conference

Mi, 2015-01-21 19:25

jQuery UK will take place on March 6, 2015 in Oxford, UK. This event is organised by White October Events with support from the jQuery Foundation.

jQuery UK is the UK’s largest front-end developer conference. Now in its fourth year, two packed tracks will feature the biggest names in front-end, including Bootstrap creator Mark Otto, Standardista Estelle Weyl, Google Engineer Addy Osmani and Jenn Schiffer of Bocoup.

Practical sessions will cover topics including architecting client-side code for resilience, making your code more readable and expressive, and designing for displays that don’t exist yet.

There are four hands-on workshops taking place the day before the conference. Choose from:

  • Practical & powerful HTML, CSS, and JavaScript
  • Advanced jQuery Techniques
  • AngularJS Foundations
  • Web Developers Workflow

Space for these workshops is strictly limited, so book early to secure your spot!

Tickets are on sale now at £190 + VAT.

To book tickets or sign up for updates, visit You can also track jQuery UK on and follow @jquk for updates.