News-Feeds

Ruby Error Handling, Beyond the Basics

Javascript News - Di, 2015-06-16 12:50

Imagine you're riding a bike. Now, imagine the designers of that bike built it so it rides smoothly only on roads without bumps and encountering one would result in the entire bicycle breaking! You wouldn't want that, would you? Yet this is how thousands of software developers design their software every single day. They put error handling in as an afterthought, dealing with it only when it's inevitable.

The truth is, it's not their fault. Most of the material on this subject is very basic, covering simple things like raising an error, rescuing it, different error types and...that's about it. This article will attempt to go deeper than that. I assume you're familiar with the basics of error handling (using raise, begin/rescue, what StandardError is, error inheritance). That's the only prerequisite for reading this article. Let's begin.

What Did We Do Before Raising/Handling Exceptions?

Before exceptions were invented, the primary method of communication that something in the program has failed was through error return codes. As time passed, people looked at ways to clearly distinguish between what their program does and what would happen if it didn't do what it was supposed to (return codes were far from ideal for this purpose) do. Thus, the invention of language constructs like:

  • raise
  • rescue
  • begin/end (Many other languages use different wording, like try/catch or throw, but the idea behind it remains the same.)

There are opposing views to using exceptions and error handling in the first place. Some of these points make sense and we'll discuss them later in the article. For now, let's get you familiar with some of the ways of handling errors in Ruby that can help you manage them better.

Continue reading %Ruby Error Handling, Beyond the Basics%

Composition in Aurelia.io: Creating a Report Builder

Javascript News - Mo, 2015-06-15 20:00

When learning about a new framework we often see trivial demos depicting the framework’s basic features, for example the well-known TodoMVC Application. And that’s great — I mean who doesn’t like Todo apps, right? Well today, we’re going to take a slightly different tack. We’re going to shun the generic and instead focus on one of the unique core features of the Aurelia framework: visual composition.

Aurelia, the new kid on the block, has already been introduced in a previous article, along with it’s capabilities of extending HTML. By the end of this article we should get a better understanding of how composition helps to assemble complex screens out of small resuable components. To do so we’re going to create a report builder app. You can find a demo of the app here and find the full source code here.

What Is Visual Composition?

The basic idea of composition in computer science is to take small entities, in the case of object composition, simple objects/data types, and combine them into bigger and more complex ones. The same thing applies to function composition, where the result of one function is passed as the attribute to the next and so on. Visual composition shares this fundamental concept by allowing one to aggregate multiple distinct sub-views into a more complex view.

An important thing to consider when talking about visual composition is the difference between heterogeneous and homogeneous sub-items. In order to understand this, lets look at the following figure.

Comparison of visual composition types

On the left side we see an example of homogeneous composition. As the name suggests, this is all about rendering items which have the same type and only varying content. This type of composition is used in most frameworks when creating repeated lists. As the example depicts, imagine a simple list of items being rendered sequentially one after another. On the right side we can see an example of heterogeneous composition. The major difference is the assembly of items which have different types and views. The example demonstrates a page consisting of several building blocks with different content and purpose.

A lot of frameworks offer that functionality via router-views, where specific view-regions are placed on the screen and different route endpoints are loaded up. The obvious drawback of this method is that the application requires a router. Besides that, creating complex view compositions can still become quite a tedious task, especially if you take nested compositions into account.

Aurelia on the other hand offers, in addition to the router-view, an alternative approach by exposing visual composition as a first-class feature via a custom element. That way it enforces the separation of concerns even on a visual level and thus leads the developer towards the creation of small and reusable components. The result is increased modularity and the chance to create new views out of already existing ones.

Using Aurelia’s Compose Element

In order to make use of visual composition within Aurelia, we can utilize the predefined compose custom element. It operates on one of Aurelia’s key conventions, the view and view-model (VM) pairs (which this article will also be referring to as a page). In short, compose allows us to include a page at any particular position inside another view.

The following snippet demonstrates how to use it. At the position we’d like to include the Hello World page, we simply define the custom element and set the value of its view-model attribute to the name of the file containing the VM definition.

[code language="html"]

Hello World

model.bind="{ demo: 'test' }">

[/code]

If we need to pass some additional data to the referenced module, we may use the model attribute and bind a value to it. In this case we pass on a simple object, but could also reference a property from the calling VM.

Now the HelloWorld VM can define an activate method, which will get the bound model data passed as an argument. This method may even return a Promise, e.g. in order to get data from the backend, which will make the composition process wait until it’s resolved.

[code language="js"]
export class HelloWorld {
constructor() { }

activate(modelData) {
console.log(modelData); // --> { demo: 'test' }
}
}
[/code]

Besides loading the VM, the corresponding HelloWorld view will also be loaded and its contents placed into the compose element.

But let’s say that we don’t want to follow that default convention of VM and view pairs. In this case we can use the additional attribute view and point it to the HTML file we’d like to use as a view.

[code language="html"]
model.bind="{ demo: 'test' }"
view="alternative-hello-world.html">
[/code]

In this case the VM will still be loaded, but instead of loading hello-world.html the composition engine will insert the contents of alternative-hello-world.html into the compose element. Now what if we need to decide dynamically which view should be used? One way we can accomplish this is to bind the view attribute to a property of the calling VM, whose value will be determined by some logic.

[code language="js"]
// calling VM
export class App {
pathToHelloWorld = "alternative-hello-world.html";
}

// calling view
model.bind="{ demo: 'test' }"
view.bind="pathToHelloWorld">
[/code]

This is fine but might not fit each use case. What if the HelloWorld VM needs to decide itself which view it wants to show? In that case we simply let it implement a function called getViewStrategy which has to return the name of the view file as a string. An important thing to note is, that this will be called after the activate function, which allows us to use the passed on model data, to determine which view should be displayed.

[code language="js"]
export class HelloWorld {
constructor() { }

activate(modelData) {
this.model = modelData;
}

getViewStrategy() {
if( this.model.demo === 'test' )
return 'alternative-hello-world.html';
else
return 'hello-world.html';
}
}
[/code]

Continue reading %Composition in Aurelia.io: Creating a Report Builder%

Filtering Reality with JavaScript and Google Cardboard

Javascript News - Mo, 2015-06-15 18:00

The ability to run virtual reality within a mobile browser is empowering and exciting. Google Cardboard and other similar VR devices make it unbelievably simple, just place your phone into the holder and go! I previously covered Bringing VR to the Web with Google Cardboard and Three.js, where I discussed the basics of building a VR environment that pulls in web data. People really enjoyed that article (and I really enjoyed building that demo) so I thought I'd expand on it with a different idea. Rather than bringing in web APIs, why not bring in your phone's camera and turn this into an Augmented Reality experience?

In this article, I'm going to explore how we can pull in camera data, filter it and display it back using HTML5 and JavaScript. We'll do this all through a stereoscopic vision effect to create an Augmented Reality experience for Google Cardboard and other VR devices. We'll apply a few different filters to our camera stream - a cartoonish greyscale filter, a sepia film style filter, a pixelated filter (my favorite) and an inverse color filter.

If you are completely new to filtering images with HTML5, the canvas tag and JavaScript, I have a whole course on the topic over at Learnable called JavaScript in Motion! I'll be approaching this article with the assumption that you understand the canvas and video tags, along with how to stream videos into the canvas tag. Or with the assumption that you're confident enough to work it out as you go!

Demo code

If you're keen to get straight into the code and try it out, you can find it here on GitHub.

Want to try it in action? I've got a running version hosted here: Reality Filter.

How This Will Work

We'll be taking the same initial set up from the previous Google Cardboard article - a Three.js scene that we display through a stereoscopic effect. That effect allows us to have a display for each eye, making things look wonderfully 3D in VR. However, rather than floating particles and such from the previous article, we remove most elements and place one simple Three.js mesh in front of the camera that plays our camera feed.

Our Code Explained

Looking at our variable declarations, most of the variables here will look familiar to those who've gone through the previous demo. The variables for preparing our Three.js scene, camera, renderer, element for our canvas output, container to place that element in and a variable to store our stereoscopic effect are all the same.

[code language="js"]
var scene,
camera,
renderer,
element,
container,
effect,
[/code]

Our three new variables related to our camera feed are video, canvas and context.

[code language="js"]
video,
canvas,
context,
[/code]

  • video - Our actual HTML5 <video> element. That will have our camera feed playing within it.
  • canvas - A virtual canvas element that will have the contents of our video element. We will read in the video data from this canvas and then add our theme filters back onto it, before placing its contents into our Three.js scene.
  • context - Our canvas' 2D context which we use to perform most functions against it.

We have a few other variables under those which relate to our filter functionality.

[code language="js"]
themes = ['blackandwhite', 'sepia', 'arcade', 'inverse'],
currentTheme = 0,
lookingAtGround = false;
[/code]

  • themes - An array of the names of our filters.
  • currentTheme - The index we're currently viewing within the themes array.
  • lookingAtGround - Whether or not we've looked at the ground (this one will make more sense soon).

We start with our init() function setting up our scene, camera and so forth as before:

[code language="js"]
init();

function init() {
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(90, window.innerWidth / window.innerHeight, 0.001, 700);
camera.position.set(0, 15, 0);
scene.add(camera);

renderer = new THREE.WebGLRenderer();
element = renderer.domElement;
container = document.getElementById('webglviewer');
container.appendChild(element);

effect = new THREE.StereoEffect(renderer);

element.addEventListener('click', fullscreen, false);
[/code]

We do not have any camera movement functionality via the DeviceOrientation event this time around. Compared to a VR experience, we won't need to change the actual camera position in this Three.js scene. We're keeping the scene in the same spot - the camera feed is what will be moving when the user looks around.

One listener we have kept from the previous example is an event listener to go fullscreen if we tap the scene. This removes the Chrome address bar from our view.

A Different Use For DeviceOrientationEvent

There is a new use for the DeviceOrientationEvent in this demo. We set it to watch for changes in the orientation of our device and use that as a trigger for switching our filter. We don't really have any physical controls to trigger events, so we control things by where the user is looking. In particular, we change the filter any time the user looks at the ground.

[code language="js"]
if (window.DeviceOrientationEvent) {
window.addEventListener('deviceorientation', function(evt) {
if (evt.gamma > -1 && evt.gamma < 1 && !lookingAtGround) {
lookingAtGround = true;
currentTheme = (themes.length > currentTheme+1) ? currentTheme+1 : 0;

setTimeout(function() {
lookingAtGround = false;
}, 4000);
}
}.bind(this));
}
[/code]

In this code, we watch for whether the evt.gamma is between -1 and 1. If so, they're looking at the ground. This is quite a precise spot on the ground, if you find it too small and difficult to trigger, you can increase the range to between -1.5 and 1.5... etc.

When they are looking in this range and when lookingAtGround is false, we run our theme switcher code. This adjusts currentTheme to the next index number of our themes array. We set lookingAtGround to true and set it back after 4 seconds. This ensures we only change the filter once every four seconds at most.

Continue reading %Filtering Reality with JavaScript and Google Cardboard%

A Comprehensive Comparison of WordPress Commenting Plugins

Javascript News - Mo, 2015-06-15 17:00

Engagement, engagement, engagement. My brother Lee and I are web developers and entrepreneurs. We try to capitalize on every opportunity available to increase user engagement. A critical part of any strategy aimed at improving user engagement involves allowing users to comment on website articles/blog posts. Commenting is possible on any WordPress site via WordPress’ default commenting functionality or by installing a third party plugin. However, WordPress’ default commenting lacks some important features that tend to increase user interaction. It also requires the installation of the Akismet plugin to keep your site’s comments spam free. In addition, there was recent news uncovering a cross site scripting bug (the 0 Day Bug) in WordPress’ commenting when Akismet is absent (but a patch has been released). For these reasons, we opt for alternatives to WordPress’ default commenting functionality. We researched four popular third party commenting plugins: Disqus, Facebook, Livefyre and Google Plus. We delved into the user and admin features offered by each plugin, their configuration processes, and some shortcomings to provide an in depth comparison of your options.

Continue reading %A Comprehensive Comparison of WordPress Commenting Plugins%

Boxing up your Apps as Phars Quickly and Easily with Box

Javascript News - Mo, 2015-06-15 16:00

In this tutorial, we’ll use Box to package a PHP application into a Phar, in order to make it easily distributable and globally installable via Composer. We’ll also learn how to distribute it so that it’s installable via Composer.

On what?

We need a project for this, and packaging up yet another “Hello World” script would be pointless. We’ll use Webiny’s FolderBuilder, a tool which you can use to plan out the folder structure for your project, interactively drag and drop files and folders, and even export and share these structures with others.

Continue reading %Boxing up your Apps as Phars Quickly and Easily with Box%

How to Work Content Marketing Like Paul Jarvis

Javascript News - Mo, 2015-06-15 16:00

This post was originally published on Paul Jarvis’ Medium blog, which you can find here. People call me a “content marketer” often (not sure if it’s a compliment or insult), so let’s talk about how you can use the articles you write to sell the products or service you’ve got. Too often, clients, friends, and […]

Continue reading %How to Work Content Marketing Like Paul Jarvis%

Forget UX. How to Focus on Conversion Centered Design

Javascript News - Mo, 2015-06-15 15:00

When you start a design project – what do you aim for? What principles do you go by? I’m quite curious to know what goes on in your head. Over the last few weeks, I’ve seen dozens of new business owners launch their website. This was in an online business course that I was part […]

Continue reading %Forget UX. How to Focus on Conversion Centered Design%

Building a JavaScript Autocompelete Widget with Awesomplete

Javascript News - Fr, 2015-06-12 18:00

Autocomplete is a feature in web applications which predicts the rest of a word or sentence while the user is still typing. Users usually press the tab key to accept a suggestion, or the down arrow key to accept one of several.

In this tutorial we will look at how to use the Awesomplete JavaScript library to create an autocomplete widget in our websites. Awesomplete is created by Lea Verou, a well-known speaker, author and invited expert in the W3C CSS working group.

Why Not Use the HTML5 datalist Element?

The HTML5 datalist element is possibly the simplest way to implement an autocomplete feature in a website. Unfortunately, browser support for this element is limited and it’s implementation is inconsistent (e.g. Chrome matches only from the start, Firefox anywhere). It’s also not possible to style it according to your website’s design and, although promising, it’s probably not the right choice yet.

Awesomplete, on the other hand, is an ultra lightweight, customizable autocomplete widget, which you can drop into your pages. It has zero dependencies (no jQuery), works across all modern browsers and can be styled according to your website’s theme.

So what are we waiting for? Let’s dive in!

Including Awesomplete in Your Web Page

To use the Awesomplete library we need two files: awesomplete.css and awesomplete.js.

You can get these using bower:

[code language="bash"]bower install https://github.com/LeaVerou/awesomplete.git#gh-pages[/code]

By downloading them from the Awesomplete website directly.

Or, by including them via the RawGit CDN (which serves raw files directly from GitHub with proper Content-Type headers). This is demonstrated below.

To instantiate the basic widget, you need an input element with a class of awesomplete, followed by the assosciated options in a datalist element. The list attribute of the input element must match the id of the datalist element. This is a sensible default configuration, as it offers a fallback to any users with JavaScript disabled.

[code language="html"] < !doctype html> One Two Three [/code] Basic Functionality

There are many ways to use this versatile library. Let’s start with a basic use case.

Using the data-list Attribute

It is possible to move the options from the aforementioned datalist element into a data-list attribute on the input element itself.

[code language="html"] [/code]

See the Pen Awesomplete (1) by SitePoint (@SitePoint) on CodePen.

Continue reading %Building a JavaScript Autocompelete Widget with Awesomplete%

How to Get a Web Development Job

Javascript News - Fr, 2015-06-12 17:00

There are plenty of jobs available in the web development field, and the number seems to be growing every day. At the same time, however, getting one of those jobs for yourself may not always be a simple task. In this article, we'll look at a few things you can do to make your search […]

Continue reading %How to Get a Web Development Job%

On Our Radar: Preprocessors, Taskbars, and Board Games

Javascript News - Fr, 2015-06-12 17:00

This week, we discovered a fun drinking game for web devs. It goes like this: 1. think of a noun. 2. google “noun.js”. 3. if it exists, drink. On Our Radar We began the week with a fairly heated discussion on which preprocessor was best: Sass or Less. Most people said Sass. Hardly any said […]

Continue reading %On Our Radar: Preprocessors, Taskbars, and Board Games%

Exploring Github’s Public Events with PHP and Google BigQuery

Javascript News - Fr, 2015-06-12 16:00

If you’ve been following along with my previous articles about Github’s API, you know that Github’s developers are doing their best to ease the pain of interacting with Github data. In this article, we’re going to take a look at the Github public events API and we will build a small demo along the way.

What are Github Public Events?

Github events are interactions made by users, like pushing, merging, creating repositories, etc. It’s like storing the history of Github. However, we are limited to the last 300 events, and that’s a problem if you want to search through the data of the whole history.

Ilya Grigorik wanted to keep track of his open source project, but due to the limitation of the Github public events API, he decided to create the GithubArchive website where he queries the Github API and stores the results. You can query the archive with links like http://data.githubarchive.org/2015-01-01-15.json.gz and you’ll get an archive containing the JSON payload. This solution is not really efficient and doesn’t help with querying the history for data, so, when Google BigQuery was released, Grigorik moved all of his data to the new storage and made it public.

Why BigQuery?

Google BigQuery was created to solve the queries latency problem. When you’re dealing with big data, you need to have the right hardware and infrastructure to handle the load properly. Now, you have the opportunity to move your append-only database to Google’s infrastructure and see millions of data rows processed in seconds.
If you’re not familiar with Google APIs, be sure to check this guide about starting a new Google API project. After that, be sure to enable the BigQuery API on your Google developers console.

Continue reading %Exploring Github’s Public Events with PHP and Google BigQuery%

A One-Month Break from Customer Support, For Free

Javascript News - Fr, 2015-06-12 06:47

There are three factors to customer satisfaction: quality, consistency and scale. That matters across the board: from your product itself to how your team addresses support. If you run a business, customer support is either a highlight of your day, or a huge contributor to the background anxiety that often fuels passionate work. You love your customers, and want to give each request personal attention, as soon as possible! You also love your business and need to focus on the million other tasks on your to-do list. So, too often, the support queue grows, and you know that, at some point, you’ll have to apologize for the late reply. Influx was born out of the SitePoint Group to help with exactly that. Our new sister company does this by providing high-quality responses that scale up (or down!) based on your support volume. Best of all, your customers have their queries answered within 5 hours regardless of where they are in the world. You have round-the-clock monitoring for your servers (right?), so why not do the same for your customers? Here at SitePoint, we’ve been using Influx as part of our customer support team for Learnable, our learning platform, and the experience has been fantastic. Within our first month of using Influx, we cut our average response time in half (to less than 12 hours) while attaining a 100% customer satisfaction rating. As a bonus, our collective stress levels have lowered, too — I’m no longer anxiously looking at our support queue several times a night. To share the love, we’ve struck a deal with Influx to offer 100 SitePoint readers a full month of customer support for free. Fill out the form below to claim your spot: Your nameEmailWebsiteTell us about yourselfThanks for your submission!

Continue reading %A One-Month Break from Customer Support, For Free%

AngularJS Testing: Bootstrap Blocks, Routes, Events, and Animations

Javascript News - Do, 2015-06-11 20:00

In the process of building and delivering full featured software, we apply several techniques to check the correctness and quality of the software. Unit testing is one of these techniques. Many organizations pay a lot of attention towards unit testing as it reduces the cost of finding and fixing potential issues of an application. As we start developing applications with hundreds of thousands of JavaScript lines, we can't escape from testing the code. Several JavaScript developers say that testing JavaScript is even more important as behavior of the language is unknown until runtime. Thankfully, AngularJS makes testing the code written using the framework easier by supporting features like Dependency Injection (DI). In three of my past articles, I discussed a few tips on mocking, how to test controllers, services and providers and how to test directives. This article will cover testing Bootstrap blocks of an AngularJS application (includes config blocks, run blocks and route resolve blocks), scope events and animations. Testing Config and Run blocks Config and run blocks are executed at the beginning of the life cycle of a module. They contain important logic that controls the way a module, a widget, or an application works. It's a bit tricky to test them as they can't be called directly like other components. At the same time, they can't be ignored as their role is crucial. Consider the following config and run blocks: [code language="javascript"] angular.module('configAndRunBlocks', ['ngRoute']) .config(function ($routeProvider) { $routeProvider.when('/home', { templateUrl: 'home.html', controller: 'HomeController', resolve: { bootstrap: ['$q', function ($q) { return $q.when({ prop: 'value' }); }] } }) .when('/details/:id', { templateUrl: 'details.html', controller: 'DetailsController' }) .otherwise({ redirectTo: '/home' }); }) .run(function ($rootScope, messenger) { messenger.send('Bootstrapping application'); $rootScope.$on('$locationChangeStart', function (event, next, current) { messenger.send('Changing route to ' + next + ' from ' + current); }); }); [/code] Similarly to the case of testing providers, we need to make sure that the module is loaded before testing the functionality inside the config and run blocks. So, we will use an empty inject block to load the modules. The following snippet mocks the dependencies used in above block and loads the module: [code language="javascript"] describe('config and run blocks', function () { var routeProvider, messenger; beforeEach(function () { module('ngRoute'); module(function ($provide, $routeProvider) { routeProvider = $routeProvider; spyOn(routeProvider, 'when').andCallThrough(); spyOn(routeProvider, 'otherwise').andCallThrough(); messenger = { send: jasmine.createSpy('send') }; $provide.value('messenger', messenger); }); module('configAndRunBlocks'); }); beforeEach(inject()); }); [/code] I intentionally didn't mock the $routeProvider object as we'll test the registered routes later in this article.

Continue reading %AngularJS Testing: Bootstrap Blocks, Routes, Events, and Animations%

Introducing Pure.css – A Lightweight Responsive Framework

Javascript News - Do, 2015-06-11 19:15

Frameworks make it easy to design websites. You may already have been using popular frameworks like Bootstrap in your projects. Today I will introduce you to Pure.css (simply referred to as “Pure”), a small framework made up of CSS modules. All its modules put together weigh less than 4.0KB if served minified and gzip'd. You can save even more bytes if you decide to use only one or two of the modules.

Pure’s minimal styling ensures that you can customize the look of elements to suit your needs without much effort. You can include Pure in your projects using the following line:

[code language="html"] [/code] Introducing the Grid System

The grid system in Pure differs considerably from that of Bootstrap and it is powerful and easy to work with once you get past the basics. There are a few things that you need to keep in mind before proceeding:

  • Pure has a wrapper grid class called pure-g and unit classes named pure-u-* . Make sure all your content is inside the grid units for proper rendering.
  • Widths are calculated based on fractions. The fractions themselves are decided by class names. For example, pure-u-2-5 has a width of 40%.
  • All child elements within a pure-g element must have the class name pure-u or pure-u-* .

By using additional class names like pure-u-md-2-3 you can control the width of different elements at specific breakpoints. Take a look at the following HTML:

[code language="html"] One Two Three [/code]

The above code does the following: When the screen size is smaller than 568px, all divs will be 100% wide. When the screen size is above the medium screen category (768px) the first div is set to a width of 20% while others are 40% wide each.

The grids are based on a 5th and 24th fraction system. For example, in the class name pure-u-x-24, x can be anything between 1 and 24 inclusive. Furthermore, pure-u-1-12 and pure-u-2-24 are the same. For a more detailed discussion of the grid system, refer to the official documentation.

Navigation Menus in Pure

Pure provides vertical menus by default. Minimal styling and use of low-specificity selectors make it a lot easier to customize the menus. Here is the code to create a vertical menu:

[code language="html"] Brand Name [/code]

To change the above menu to horizontal, add the class name pure-menu-horizontal. Additionally, you can mark a menu item as selected or disabled using the class names pure-menu-selected and pure-menu-disabled, respectively.

Creating Dropdown Navigation

Creating dropdown navigation requires small changes in the markup. You need to add the class name pure-menu-has-children to the appropriate menu item. To display the submenu on hover, include the class name pure-menu-allow-hover. The code snippet below should clear things up:

[code language="html"] [/code]

You can also include this example script written in vanilla JavaScript to make the menu more accessible. It provides ARIA support, submenu arrow key navigation, and menu dismissal based on outside events.

Below is a demo of Pure's navigation menu with a dropdown.

Continue reading %Introducing Pure.css – A Lightweight Responsive Framework%

5 Stunning WordPress Portfolio Themes for Designers

Javascript News - Do, 2015-06-11 18:00

Portfolios are difficult endeavours. If you meet any designer, chances are they will mention their portfolio at some point. Just look at Behance or Dribbble; these communities organize Portfolio Reviews or Meetups regularly to mingle with their own kind, so their portfolio is always up to date.

Obsessions aside, having a portfolio is a need in today’s digital age. Where a physical portfolio is seen very rarely these days, you will find it hard to land a job or gig without a portfolio or an established online presence, especially as a creative.

While it’s very helpful to be present on social networks for designers as Behance or Dribbble, you might want to settle with an independently hosted portfolio which you have control over. As an open source CMS, WordPress is perfect for this task.

I won’t be getting into the details how to install a WordPress installation, instead I'm going to suggest some of the best WordPress portfolio themes I witnessed this year. Some of them are accompanied with a real use case so you will be able to see how this might look outside of the idealistic preview of the theme providers.

Continue reading %5 Stunning WordPress Portfolio Themes for Designers%

It’s Competition Time! Post in June, and Win Big!

Javascript News - Do, 2015-06-11 17:13

“OMG I love competitions!” I hear you say. Of course you do, who doesn’t like a good win? During the month of June, you can win one of eight incredible prizes just for posting on the SitePoint forums. You read correctly: just for posting on the SitePoint forums in June, you can win. Big. Every […]

Continue reading %It’s Competition Time! Post in June, and Win Big!%

Infographic: Are You a Victim of “The Struggle?”

Javascript News - Do, 2015-06-11 16:00

This piece was originally found on growth everywhere, a site where the worlds top entrepreneurs are interviewed. According to Ben Horowitz, The Struggle is when your dreams turn into nightmares. “…Then, after working night and day to make your vision reality, you wake up to find that things did not go as planned. Your company […]

Continue reading %Infographic: Are You a Victim of “The Struggle?”%

Atomic: A Faster Way To Design Beautiful Interactions?

Javascript News - Do, 2015-06-11 15:00

Interaction design is the art of creating logical responses to a user's action on the web. Whether you're an interaction specialist, a user experience consultant, or a broadly-skilled web designer, it's your responsibility to decide how a web element reacts to interaction and communicate that to the development team, even if you don't quite understand the technologies that they'll use.

But what is the fastest way to do that, without walking over to your developers desk and gesturing insane hand movements?

Also, what if you work remotely?

Atomic finally released their beta last week and it's the fastest way of sampling an interaction idea and sending it out.

Before Atomic

FramerJS, Origami and Pixate are some of the tools at our disposal already, but we don't always want to code our interactions or test them on native devices, do we?

Atomic is blazingly fast, and if you're coming from a Sketch App background, it's even better. It mimics the same keyboard shortcuts, has the same intuitive snap-to features, and quite honestly it felt like I was using Sketch, only with the ability to prototype interactions.

Getting Started

Ready to start? It'll only take a few minutes of your time. Head over to the atomic website, sign up for the beta, and select "New Design" at the Projects screen. In this small tutorial we'll be transitioning a dropdown arrow into a close icon upon a click interaction.

Creating The First State

Press "L" to initiate a simple Line.

The other shortcuts are "S" for Select, "R" for Rectangle, "O" for Oval, "T" for Text, "I" for Image and "H" for Hotspot.

You can hold "Shift" while dragging to create a completely accurate 45 degree angle; to skip ahead a few steps, the X, Y, X2 and Y2 should be 350, 250, 450, 350 respectively, and also make sure the "Stroke" is 10px.

Press "D" for Duplicate and enter a new set of coordinates: 453, 250, 443 and 350. We now have our dropdown icon, but we need it center-aligned. See the layers on the left-hand side? Click both of them while holding Shift and drag both lines together into the center of the artboard. You'll know you've hit the spot when the red auto-alignment lines appear.

We've created our first state.

Creating The Second State

Click "Pages" in the layers sidebar; click "Page 1" on the card and rename it to something more relevant, like State 1 (Dropdown). Click the hamburger menu icon, also on the card, and duplicate our first state - then rename the duplication to State 2 (Close).

Switch back to "Layers" and select that right-most line; drag it to the left until the dropdown icon resembles a close icon. Repeat the multiple layer select step (by selecting both layers while holding Shift, in case you forgot) and drag into the center of the artboard again.

Creating Interactive Hotspots

Now this is where the magic happens. Press "H" to create a Hotspot. Since we're only sampling a single interaction, the hotspot can be any size you wish, as long as it fully covers the dimensions of our icon.

After you've created the hotspot, a new set of options will appear. Under the "Interaction" heading, select the first state as the "Go To" option. Select "Cubic: Ease Out" as the animation type. Atomic is able to handle interactions of much higher complexity, but for the sake of this tutorial we'll keep it simple and use the default values for the other options.

Continue reading %Atomic: A Faster Way To Design Beautiful Interactions?%

A Simple Gulp’y Workflow For Sass

Javascript News - Do, 2015-06-11 14:00

I have recently been in charge of optimizing the Sass side of quite a big Rails project, and one of most important things to do was to improve the compilation time. Because of the Sass architecture in place and the fact that Ruby Sass (through the Rails asset pipeline in this case) tends to be slow when dealing with a huge number of files, it could take up to 40 seconds to compile the stylesheets. Talk about a fast development process. :)

My idea was to move away from the asset pipeline and embrace the speed of LibSass. To make things easier I decided to go with a simple Gulp workflow. It was the first time I would be using Gulp, and I must say it was quite an enjoyable experience (which was not the case for Grunt as far as I am concerned).

In this short article, let's just have a quick tour on how to set up a Gulp'y workflow to work with Sass. Here is what we will include:

  • Unsurprisingly, Sass compilation with LibSass
  • Generating sourcemaps for easier debugging
  • Prefixing CSS with Autoprefixer
  • Generating Sass documentation with SassDoc

Continue reading %A Simple Gulp’y Workflow For Sass%

What’s New in Rails 5

Javascript News - Do, 2015-06-11 14:00

Rails 5 is right around the corner (currently targeting Fall 2015) and there are some exciting features coming up. If you are running a Rails shop, you need to prepare your apps for this major release.

Don't worry. As always, we at Sitepoint will guide you throughout the migration process when the release date approaches. For now, let's catch you up on what's coming and how it will improve your development process.

Major Improvements

There are some amazing announcements that will fundamentally shift how we work with Rails. New features like Action Cable and improved Turbolinks that can instantly improve our web development workflow. Let's look at each of them in detail.

Continue reading %What’s New in Rails 5%