• Shortcuts : 'n' next unread feed - 'p' previous unread feed • Styles : 1 2

» Publishers, Monetize your RSS feeds with FeedShow:  More infos  (Show/Hide Ads)


Date: Thursday, 17 Apr 2014 11:59

The REM unit is the hottest thing since Christina Ricci … it’s hot.  And it’s especially hot when it comes to font size.  Rather than paraphrase a bunch of documentation as to why REM is important, I’d like to point you to Jonathan Snook’s outstanding Font sizing with rem post, where he explains sizing with PX, EM, and how REM comes into the picture.  Here’s how I implemented REM sizing within Stylus with a PX fallback!

The Stylus CSS

My method uses two mixins to accomplish the feat: one to set the base font-size and another to rem-ify the pixel unit:

set-font-size(value) {
    font-size: value; /* add PX as backup */

    if (value is inherit) {
        /* do nothing, "inherit" has no unit */
    } else {
        font-size: remify(value);
    }
}

remify(value) { /* separate mixin, so it can be used elsewhere */
    u = unit(value);

    if u is 'px' {
        return unit(value/16, 'rem');
    } else {
        return unit(value, u);
    }
}

The 16 within the remify unit represents the base font size, in pixels, that rems should be calculated by. The usage and output looks as follows:

.smaller {
	set-font-size(13px);
}

/*
	yields:

	.smaller {
		font-size: 13px;
		font-size: .8125rem;
	}

*/

Don’t forget to set the base font size on the html element, usually 100%.  Also remember this mixin assumes a PX font is passed in, so if you aren’t looking to use PX as backup, this isn’t the solution for you.  If you do, however, there’s no hurt in using these Stylus mixins!

Read the full article at: Stylus PX to REM Mixin

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "CSS, JavaScript"
Comments Send by mail Print  Save  Delicious 
Date: Tuesday, 15 Apr 2014 17:11

I’ve been working on a new feature for the Mozilla Developer Network which requires loading of a basic script file as well as a JSON stream.  Since we use jQuery, that means a jQuery.getScript and a jQuery.getJSON.  I know those both work asyncronously and return a Deferred, so I wondered if there was a way that I could load them in parallel with one callback, much the way JavaScript loaders like curljs do.  I was in luck!  Using jQuery.when, I can load both requests concurrently with one callback!

The jQuery JavaScript

As I mentioned, my use case was loading a script and a JSON resource, so how it works is:

$.when(
	$.getScript('/media/js/wiki-min.js?build=21eb633'), 
	$.getJSON('https://developer.mozilla.org/en-US/demos/feeds/json/featured/')
).then(function(a, b) {  // or ".done"
	
	// Yay, stuff loaded and now we can do something!

});

When the resources are done loading, the done or then callback fires and I know the requests are complete.  Each request type provides a different callback argument object, so the above would provide:

// [response, state, jqxhr], [response, state, jqxhr]
["(function(c){var e=c(".from-search-navigate");if(e…;if(j){g.apply(m,l)}}}})(window,document,jQuery);", "success", Object]
[Array[15], "success", Object]

If we wanted to add a traditional AJAX XHR request to the mix, say a widget template, we could do that too:

$.when(
	$.getScript('/media/js/wiki-min.js?build=21eb633'), 
	$.getJSON('https://developer.mozilla.org/en-US/demos/feeds/json/featured/'), 
	$.get('/')
).then(function(a, b, c) { 
	console.log(a, b, c); 
});

The Dojo Toolkit has had this type of functionality for a long time but I’m stoked that modern jQuery allows for the same.  Making multiple requests with one callback seems as relevant as any other task these days, so jQuery’s definitely moving with the times!

Read the full article at: jQuery: Multiple AJAX and JSON Requests, One Callback

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "AJAX, jQuery"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 14 Apr 2014 13:27

You’ve probably heard the talk around the water cooler about how promises are the future. All of the cool kids are using them, but you don’t see what makes them so special. Can’t you just use a callback? What’s the big deal? In this article, we’ll look at what promises are and how you can use them to write better JavaScript.

Promises are Easier to Read

Let’s say we want to grab some data from the HipsterJesus API and add it to our page. This API responds with data that looks like this:

{
  "text": "<p>Lorem ipsum...</p>",
  "params": {
    "paras": 4,
    "type": "hipster-latin"
  }
}

Using a callback, we’d write something like this:

$.getJSON('http://hipsterjesus.com/api/', function(data) {
  $('body').append(data.text);
});

If you’re experienced with jQuery, you’ll recognize we’re making a GET request and expecting JSON in the response body. We’re also passing in a callback function that takes the response JSON and adds it to the document.

Another way to write this is to use the promise object returned by the getJSON method. You can attach a callback to this object directly.

var promise = $.getJSON('http://hipsterjesus.com/api/');

promise.done(function(data) {
  $('body').append(data.text);
});

Like the callback example, this appends the result of the API request to the document when the request is successful. But what happens if the request fails? We can also attach a fail handler to our promise.

var promise = $.getJSON('http://hipsterjesus.com/api/');

promise.done(function(data) {
  $('body').append(data.text);
});

promise.fail(function() {
  $('body').append('

Oh no, something went wrong!

'); });

Most people remove the promise variable, which makes it a little easier to tell what the code does at a glance.

$.getJSON('http://hipsterjesus.com/api/')

.done(function(data) {
  $('body').append(data.text);
})

.fail(function() {
  $('body').append('

Oh no, something went wrong!

'); });

jQuery also includes an always event handler that’s called regardless if the request succeed or fails.

$.getJSON('http://hipsterjesus.com/api/')

.done(function(data) {
  $('body').append(data.text);
})
.fail(function() {
  $('body').append('

Oh no, something went wrong!

'); }) .always(function() { $('body').append('

I promise this will always be added!.

'); });

With promises, the order of the callbacks is respected. We’re guaranteed to have our done callback called first, then our fail callback, and finally our always callback.

Better APIs

Let’s say we want to create a wrapper object for the HipsterJesus API. We’ll add a method, html, to return the HTML data that comes down from the API. Rather than having this method take in a handler that’s called when the request is resolved, we can just have the method return a promise object.

var hipsterJesus = {
  html: function() {
    return $.getJSON('http://hipsterjesus.com/api/').then(function(data) {
      return data.text;
    });
  }
};

The cool thing about this is we can pass around our promise object without worrying about when or how it resolves its value. Any code that needs the return value of the promise can just register a callback with done.

The then method allows us to modify the result of a promise and pass it to the next handler in the chain. This means we can now use our new API like this:

hipsterJesus.html().done(function(html) {
  $("body").append(html);
});

Until recently, one of the killer features of AngularJS was that templates could bind directly to promises. In an Angular controller, this looked like:

$scope.hipsterIpsum = $http.get('http://hipsterjesus.com/api/');

Then, it was as simple as writing {{ hipsterIpsum.text }} in a template. When the promise resolved, Angular would automatically update the view. Unfortunately, the Angular team has deprecated this feature. For now, it can be enabled by calling $parseProvider.unwrapPromises(true). I hope Angular and other frameworks include this feature going forward (I’m looking at you Ember).

Chaining

The best part about promises is you can chain them! Let’s say we want to add a method to our API that returns an array of paragraphs.

var hipsterJesus = {

  html: function() {
    return $.getJSON('http://hipsterjesus.com/api/').then(function(data) {
      return data.text;
    });
  },

  paragraphs: function() {
    return this.html().then(function(html) {
      return html.replace(/<[^>]+>/g, "").split("");
    });
  }
};

We’ve left our HTML method the same, and we’re using it in the paragraphs method. Because the return value of a promise’s callback is passed to the next callback in the chain, we’re free to create small, functional methods that change the data as it’s passed through them.

We can chain promises as many times as we want. Let’s add a method for sentences.

var hipsterJesus = {

  html: function() {
    return $.getJSON('http://hipsterjesus.com/api/').then(function(data) {
      return data.text;
    });
  },

  paragraphs: function() {
    return this.html().then(function(html) {
      return html.replace(/<[^>]+>/g, "").split("");
    });
  },

  sentences: function() {
    return this.paragraphs().then(function(paragraphs) {
      return [].concat.apply([], paragraphs.map(function(paragraph) {
        return paragraph.split(/. /);
      }));
    });
  }
};

Multiple calls

Probably the most notable feature of promises is the ability to combine multiple API calls. When using callbacks, what happens if you need to make two API calls at once? You’ll probably end up writing something like this:

var firstData = null;
var secondData = null;

var responseCallback = function() {

  if (!firstData || !secondData)
    return;

  // do something
}

$.get("http://example.com/first", function(data) {
  firstData = data;
  responseCallback();
});

$.get("http://example.com/second", function(data) {
  secondData = data;
  responseCallback();
});

With promises, this becomes much easier:

var firstPromise = $.get("http://example.com/first");
var secondPromise = $.get("http://example.com/second");

$.when(firstPromise, secondPromise).done(function(firstData, secondData) {
  // do something
});

Here, we’re using the when method to attach a handler that’s called when both requests are done.

Conclusion

That’s it! Hopefully you have a sense of some of the awesome things you can accomplish with promises. What’s your favorite way to use them? Let me know in the comments!

*Note: For simplicity, this article is using jQuery’s deferred implementation. There are subtle differences between jQuery’s Deferred object and the Promises/A+ specification, which is a more canonical standard. For more information, check out Q’s Coming from jQuery wiki.

Read the full article at: Write Better JavaScript with Promises

Treehouse

Sencha Touch Mobile Framework

Author: "Landon Schropp" Tags: "Guest Blogger, JavaScript"
Comments Send by mail Print  Save  Delicious 
Date: Wednesday, 09 Apr 2014 15:02

Google Analytics has always been more than a hit counter and demographic tool — you could build a career out of being a Google Analytics analyst.  You can measure ad campaign effectiveness, track how far into a desired page flow (think advertisement to cart to checkout) users get, and set browser and locale support based your user’s information.

But that’s all stuff for the suits, not us devs.  What us nerds can use Google Analytics for, however, is error tracking via custom events.  Here’s a quick look at how I’ve implemented error checking in analytics:

// Track basic JavaScript errors
window.addEventListener('error', function(e) {
    _gaq.push([
        '_trackEvent',
        'JavaScript Error',
        e.message,
        e.filename + ':  ' + e.lineno,
        true
    ]);
});

// Track AJAX errors (jQuery API)
$(document).ajaxError(function(e, request, settings) {
    _gaq.push([
        '_trackEvent',
        'Ajax error',
        settings.url,
        e.result,
        true
    ]);
});

Now when you go into Google Analytics, you can view the custom event information along with other site stats.  Of course you’ll tell the marketing people those aren’t really error, they’re features, but that’s another story.  Consider using Google Analytics for to track site errors — you can thank me later.

Read the full article at: Track JavaScript Errors with Google Analytics

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "Google, JavaScript"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 07 Apr 2014 23:45

I hate complexity. And when I say hate I really mean it. When you build websites several years, you start realizing that the simplicity is your best friend. As simple one system is as easy is to develop and maintain it. Nowadays, every user wants to control the content in its online appearance. For me, as a blogger, is important to work with good looking, fast and reliable CMS. The writing is difficult as its own, and if the process is tough the whole experience is not very good.

At the moment, if I want to publish an article on my blog I have to open the administration of my custom PHP CMS and make a new entry. However, I’m not happy with writing the content there, and I prepare the posts in Markdown format. When I’m ready, I transform the Markdown to HTML and publish it to the site. All the things written by me are stored in GitHub repositories.

So, as you can see, there are several steps that I have to follow before publishing something. Sometimes I’m just too lazy to do it, and I simply don’t blog. Last few months I’m thinking about changing the way of how I write. I need something new and interesting that will replace the old LAMP system. I read few articles about flat file content management systems, and I decided to invest some time in developing such on top of Node.js. While I was working on the documentation of AbsurdJS, I made a short Node.js script that uses Gulp to convert Markdown to HTML. I like how everything works and decided to take this direction.

The new toy

Two days (and nights) later and Techy was born. That’s a Node.js module that have all the characteristics of a simple flat CMS which I needed.

  • Simplicity – simply drop a markdown file and execute techy command. The module converts all the .md files into .html pages.
  • Predefined design – Techy copies the needed CSS and JavaScript (if any) into the root folder of the project.
  • Theming – of course, as every other CMS, it offers the usage of different themes. So you are able to change the main layout, the styles, the fonts, everything.
  • Partials support – along with the Markdown syntax you are able to write Techy expressions. In fact, this is just the good old JavaScript between <% and %> markers. There are some predefined methods and variables which are available. One of them is the template function. It accepts a relative path to HTML file.
  • Plain HTML support – sometimes the Markdown format is not enough. In such cases, the CMS should support adding of plain HTML.
  • Relation between the different pages – that’s pretty important feature. In the popular solutions like WordPress, for example, information like date of creation or post’s author is kept in the database. However, we do not have a database here. So, such information should be written directly into the pages. I found that this pretty useful approach, because it tights the characteristics of the article to its content.
  • Code syntax highlighter and icon font

Let’s try it

Before to start using Techy, you need to install it.

npm install -g techy

The command will setup the library as a global command line tool. Create a new folder somewhere and add the following page.md file:

# That's a test page

Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Autem, maiores, ipsa, quos ratione consectetur facilis.

Navigate to the same directory, type techy and press Enter. You should see the following screen.

Techy

Techy generates page.html next to your page.md file. Along with that it brings new folder themes. It contains the main HTML layout, the CSS styles and the JavaScript (if any) code needed for your page. Techy has Prism and FontAwesome integrated. So you are able to publish code and use cool icons without additional setup. And because the CMS uses Gulp it automatically starts listening for changes in your Markdown files.

The content of page.html should be:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Techy</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="themes/default/public/font-awesome-4.0.3/css/font-awesome.min.css">
    <link rel="stylesheet" href="themes/default/public/styles.css">
    <link rel="stylesheet" href="themes/default/public/prism/prism.css" />
    <link rel='stylesheet' href='http://fonts.googleapis.com/css?family=Open+Sans:400,800,700' type='text/css'>
</head>
<body>
    <div class="content">
        <h1 id="that-s-a-test-page">That's a test page</h1>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Autem, maiores, ipsa, quos ratione consectetur facilis.</p>
    </div>
    <script src="themes/default/public/prism/prism.js"></script>
    <script src="themes/default/public/scripts.js"></script>
</body>
</html>

Techy takes care for the boring stuff and leaves your file clean. The HTML that your content is put in is defined in themes/default/tpl/layouts/basic.html. You may change it to something else by using the following expression:

// it's looking in 
// themes/[theme name]/tpl directory
<% set('layout', 'layouts/mylayout.html') %>

You could even use your own theme. Just call the techy command with the following parameter:

techy --theme mythemename

Have in mind that the module is dealing with the paths in your files. Even if you have a deeply nested files the URLs of the CSS styles and JavaScript files will be set properly.

Now, to make the things a little bit more interesting, let’s create a custom Techy function which returns a setting defined in another page. In order to do this, we need a new Markdown file. Create profile.md and put the following text inside:

<% set('name', 'profile') %>
<% set('profile', { name: 'John Black', job: 'web developer'}) %>

Hello, I'm <% get('profile').name %> and 
I'm working as <% get('profile').job %>.
This is my profile page.

set creates property in the current page and assigns a value to it. The same value could be fetched with the get method. Now, to define a new method like get or set we have to create a JavaScript file which name ends on techy.js. For example getprofile.techy.js.

module.exports = function() {
    var profilePage = this.page('profile');
    return profilePage.get('profile');
}

The this keyword inside the function’s body points to the page that is running the method. this.page is a predefined function which accepts a name of the page. And because we defined profile property in profile.md we are now able to get its value and return it. If we update page.md with the following code:

# That's a test page

* Name: <% getprofile().name %>
* Job: <% getprofile().job %>

the result will be:

<h1 id="that-s-a-test-page">That's a test page</h1>
<ul>
    <li>Name: John Black</li>
    <li>Job: web developer</li>
</ul>

There is also pages function that returns and array of all the pages in the project. So, in theory we are able to implement whatever we need, because we have access to every single page and its defined properties.

Why you should consider the usage of flat file CMS like Techy

I could see three big benefits:

  • No database – this means that the overall page load will be reduced dramatically. You are serving only static HTML files.
  • No additional setup – you just need the files uploaded. There is no back-end technology involved. You may generate the HTML locally.
  • Super fast and easy migration – there are no configurations or database dumps for importing

Summary

Techy is an open source project available at GitHub. Its repository is located here. Feel free to fork it and make modifications, new functions or themes. I’ll be happy to push the module forward.

The official page of the tool krasimir.github.io/techy is also generated with Techy. The code could be seen here.

Read the full article at: Look Ma, no CMS!

Treehouse

Sencha Touch Mobile Framework

Author: "Krasimir Tsonev" Tags: "Guest Blogger, Node.js"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 07 Apr 2014 13:45

Just because Apple claims, “There’s an app for that,” doesn’t mean programmers are out of a job. Far from it. Every day more and more amazing, helpful, and downright fun apps are introduced. And if you’re sitting there looking to get in on the fun, take advantage of this Mighty Deal and you can get a huge jump on it!

This collection of 6 professional iOS7 iPhone App Design Templates from MyAppTemplates will save you a load of time and money. With these design templates, you can easily edit any text or images to fit your need, or dive right in and start coding the app itself! With real clean, organized code, these design templates will be a snap to work with! And if you need any further prodding, try this on for size: Act now and you can save 95% off the regular price!

iOS7 App Design Templates Bundle Highlights:

  • 6 Professional Templates
    This exciting bundle features 6 high-quality iOS7 iPhone app design templates. They’re a great way to get a huge jump on building your own app rather than starting from scratch!
  • Easy to Customize
    Each template includes the original Photoshop PSD files. That means you can easily upload your own images, photos and logos to suit your needs.
  • Clean, Organized Code
    Worried about programming your app? That won’t be a problem since all these templates were created in high-quality, native Objective-C. That gives you the perfect foundation to build upon for your app.
  • Ready to Use
    While you can customize these apps to your heart’s content, you certainly don’t have to do so. All of them are ready to go right out of the box with only a few clicks to get you started. Think of the countless hours and dollars you’ll be saving on initial design work!

Take a closer look at the 6 iOS7 app templates included in this deal:

Newsfeed (Preview)
Perfect for creating a news app that can pull in feeds from all over the Web, including WordPress feeds, News feeds, and RSS. 

  • Lush, custom design with content front and center
  • iOS7 design touches – blur on dropdowns and outlined menu logos
  • 4 color templates to choose from (tap a new color to completely change your template)

 

Taxi (Preview)
Create your own location-finder app for hunting down local taxis, restaurants or even friends.

  • Built for iOS7 and iPhone 5, 5C an 5S
  • Facebook-style slide menu
  • Gorgeous custom map view that displays user’s current location
  • Search functionality
  • Chat feature

 

Food (Preview)
Everybody’s drooling for a great recipe app, so feed their desire with this Food template!

  • Create intricate recipes
  • Display beautiful images of your meals
  • Organize recipes with special icons
  • Link to social networks to share

 

Social Share (Preview)
Love Instagram? Like Fancy? Got a similar app idea, but want to put your own twist on it? 

  • Activity feed
  • Profile view
  • Upload view
  • Explore grid view
  • Photo deatail screen
  • Beautiful, custom artwork

 

 

Tap Tag (Preview)

Maybe it’s a bad idea to mix business and pleasure, but mixing business with social can be an app goldmine!

  • Clean dashboard-style home
  • Deep scrolling image functionality
  • Rich product screens
  • Think Pinterest and Instagram but for shopping

 

 

Activity (Preview)
Run away with the Activity template to create the coolest fitness-type app around!

  • Fully compatible iOS7 fitness app
  • Turn an iPhone into the ultimate training tool
  • Build your own fitness app in the vein of Fitbit, Nike+ Running, RunKeeper or even Zombies Run!
  • Combines best features from a variety of popular fitness apps

Pricing:

This set of 6 professional iOS7 App Design Templates normally sell for $594, but for a limited time only, you can get the entire collection for a mere $29! You read that right… $29! That’s a staggering 95% off the regular price!

What are you waiting for? Start bringing your app ideas to life.

Read the full article at: Mighty Deals: 6 Professional iOS7 App Design Templates

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "Sponsored"
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 03 Apr 2014 12:51

There are so many options for you out there if you need to get a website up and running without any coding skills. How do you know which is the one for you? We’ve singled out 15 tools and platforms that really made an impression on us in 2014, and listed their benefits below, for your consideration.

IM Creator

No other platform stands a chance next to IM Creator. All of its users get advanced design tools at their disposal, for free. Whenever you set out to make a website, go ahead and browse through IM Creator’s fantastic collection of templates.

IM Creator White Label is a perfect choice for creative professionals. Anyone will find it exceptionally easy to work with this universal website building tool – as a free user, with a Premium subscription, or via a plan for Pros. Free members are at liberty to create a site that takes up to 50 Mb and is published on sub-domain. However, the Premium plan is a bargain, as it can cost as little as $5.95 per month (as part of a three year-subscription that entails the plump discount of 40%) – and with it users may publish their site on a distinct domain, customize an email account, and take up unlimited storage and bandwidth.

IM Self heralds a new age that combines website building and social networking. It’s a mobile app that has so far been experimentally launched in Japan and Australia, and we feel sure that it will soon be made available all over the world.

Webydo

Webydo gives us every reason to take a spot in our top three online website design platforms for spring of 2014. First, this B2B platform meets every independent designer’s criteria for creating professional websites. Creative professionals will be greeted with sophisticated and intuitive design features resembling that of Photoshop, making it intuitive for the savvy user to immediately start creating their clients website. Getting started on a design project is fun for the designer, since there is the option to unleash your creativity and begin the process from a blank canvas. For a bit of creative stimulation, feel free to look through some of the wonderful sites completed using Webydo, and take a step forward to start your design from one of the customizable readymade design inspirations.

Plus, you’ll see that users can change the code when it comes to CSS, as well as the website’s <header> and <body> sections. You can add elements to your site that stay on the screen and “float” when scrolling down the page.

Theme X

Say hello to X – the ULTIMATE WordPress theme. This tagline adequately describes what many are calling the best website theme ever made. For those who are looking to build a site powered by WordPress (and the majority of developers choose to do so because it requires a more technical background), this is one theme you have to see to believe.

With numerous advanced features such as a live customizer for all site administration and what they call Stacks for multiple designs built into one theme, X is a breath of fresh air to the ever so often “me too” world of WordPress Themes. In addition, THEME X engineers have consulted with numerous internet marketing experts to get their feedback on building this product. All of these contributions were then either built into the theme or provided in the form of training material in their member area. Pick up your copy of X today, and you’ll see what we mean.

Startup Design Framework

Startup Design Framework is an excellent platform for creative professionals. It’s based on Bootstrap 3 and helps designers create startup websites with unprecedented ease. You’ll absolutely love the way this platform allows you to handpick elements from a hefty list of site components, and then patch them together.

Throw a glance at the delightful selection of 25 completed templates, whose components are ready for markup. What is more, you need not worry about your landing page – a useful generator will enable you to drag-and-drop blocks, and then, as you agree with your partners on the way everything looks, all that is left to do is allow the end result to be exported into code – and your mission has been accomplished.

We recommend that you try the demo version of Startup Design Framework, which comes with full documentation, two Bootstrap samples, eleven components, and two images for iPhone, iPad, or Macbook.

DIY themes

DIY themes released version 2.1 of Thesis, a superb theme meant for WordPress-based websites. This wicked awesome design and template manager aced 3 features that are hard to come by in other site crafting tools. Not only will you find proficient ways to make your page rank rise high with the most popular search engines, but as you work to build your WordPress site, you can enlist a skin, or use boxes to get the design of your dreams.

If you’re looking for shortcuts, just choose one of the 3 existing skins and fashion it according to your taste. On the other hand, you may appreciate the chance to drag-and-drop each and every element into your design, and so use the editor to add AWeber/MailChimp forms, and social network buttons.

Onepager

As the brand name implies, Onepager is a keen choice if you have a mind to create websites made up of a single page. It is common knowledge that most people now connect to the web over a mobile phone or a tablet, and it’s always very simple to scroll down, instead of clicking on a certain number of web pages to get the whole picture. Reach out to Onepager if a single-page website is what you need.

Webzai

Webzai-generated websites are renowned for getting along flawlessly with any type of browser or device. If you go the route of this accomplished website building tool, you will have gained an easy way to create a website from A to Z, or just set your mind on a ready-made template, and populate it with your elements of choice. In any case, when you’re done, Webzai provides your website with top-rate and highly dependable cloud hosting.

Light CMS

Light CMS welcomes resellers in its community. One can’t help but notice that an 80% discount is associated with the reseller plan, where $19 is generally charged per month for every website – with access to all features, unlimited storage and pages. Adopting this pricing plan also breaks the limit to the number of products that can be posted on online stores. All in all, Light CMS is bound to keep you happy.

Elegant Themes

As many as 88 Elegant Themes for WordPress have so far been issued by this platform. Divi is the newest and most cherished theme, because it introduces a special way of creating divine-looking websites: its Page Builder allows you to designate horizontal sections, then set horizontal rows within them, and lastly, add modules. Naturally, if you’d rather edit one of the available templates, you could do that and so end up spending less energy in your project.

Moonfruit

Moonfruit is proud to present a wealthy collection of images, backgrounds, and website templates. Right now, a 10% discount to all pricing plans is active until the end of spring, or May the 31st. It’s all about the size of your business: long story short, you may like to move forward with a small package ($10.80), or go full-option and take up the biggest plan available, in exchange for $31.50. These costs are standard and don’t include the discount.

Two Way Resume

Two Way Resume introduces a simple manner of creating an elaborate professional identity online. Starting from one of the 5 templates that are placed at your disposal, it doesn’t take much to strike up an artful resume/portfolio for yourself or for one of your clients. You may even embed Vimeo and Youtube videos, and the undeniable result of such an enterprise is that many employers will be drawn in, like moths to a flame.

SnapPages

SnapPages has its rightful place in our elite selection of proficient site building platforms for designers in 2014. It offers a laudable HTML 5 page editor with drag-and-drop functionality, which rivals that of many other, similar builders. Besides, not only does it provide top-notch cloud hosting for your website once it goes live, but a spam filter for blog post comments does much in the sense of alleviating a moderator’s responsibilities.

Wix

Wix is one more faithful ally if you’re thinking of creating an online store, a personal blog, a business website, or a portfolio website. You can take of everything by yourself from start to finish, or work with the templates, images, icons, and clipart that you fancy most of all – and so create a beautiful website faster. You would also be able to set which pages are to be accessed only by you and some members of your choice.

Site Sumo

Site Sumo definitely belongs here, in our top 15. It has a 14-day free trial that does not demand fresh users to provide information about their credit cards, so by all means, feel free to give it a shot. This platform provides its creative users with an engaging point-and-click editor to modify ready-made website templates with. The completed website would sport exclusive pages that would only be accessed by clients after paying a fee.

Pixpa

Pixpa concludes our selection of this year’s most outstanding website building platforms that have really drawn our attention thus far. Evidently, this is the perfect place for photographers to put their works on display for potential customers to see, to sell their photos with Fotomoto, and much more. Parts of the portfolio could be made into private galleries, and clients could offer their feedback to each and every piece of work. Check out the 15-day free trial from Pixpa.

Here are some of the finest websites whose creation was facilitated by our favorite platforms:

IM Creator

Webydo

Theme X

Startup Design Framework

DIY Themes

Wix

Pixpa

Read the full article at: Top 15 Tools and Platforms for Creating Eye-Catching Websites

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "Sponsored"
Comments Send by mail Print  Save  Delicious 
Date: Wednesday, 02 Apr 2014 13:57

You know what’s better than adding features to a website or app, from a code perspective?  Removing stuff you don’t need.  Whether it be code, images, or dependencies, getting rid of the crap stale code is like the first sip of a big glass of wine after a long day of stressful work.  Running a directory of images through ImageOptim is a euphoric experience, am I right?  What if there was a tool, however, which would allow you to find unused CSS for a given website?  There is, and it’s called uncss, a NodeJS powered utility.  Let’s take a look at how uncss works!

A basic usage of uncss‘s command line tool would be:

uncss http://davidwalsh.name > styles.css

The output of this execution is a stylesheet featuring only the used CSS rules — unused rules are removed.  So how does uncss work?  I’ll let them tell you how:

  1. The HTML files are loaded by PhantomJS and JavaScript is executed.
  2. Used stylesheets are extracted from the resulting HTML.
  3. The stylesheets are concatenated and the rules are parsed by css-parse.
  4. document.querySelector filters out selectors that are not found in the HTML files.
  5. The remaining rules are converted back to CSS.

Like just about every NodeJS-based utility, you can also take advantage of its JavaScript API.  Here’s an example usage:

var uncss = require('uncss');

var files   = ['my', 'array', 'of', 'HTML', 'files'],
    options = {
        ignore       : ['#added_at_runtime', /test\-[0-9]+/],
        media        : ['(min-width: 700px) handheld and (orientation: landscape)'],
        csspath      : '../public/css/',
        raw          : 'h1 { color: green }',
        stylesheets  : ['lib/bootstrap/dist/css/bootstrap.css', 'src/public/css/main.css'],
        ignoreSheets : [/fonts.googleapis/],
        urls         : ['http://localhost:3000/mypage', '...'], // Deprecated
        timeout      : 1000,
        htmlroot     : 'public'
    };

uncss(files, options, function (error, output) {
    console.log(output);
});

/* Look Ma, no options! */
uncss(files, function (error, output) {
    console.log(output);
});

/* Specifying raw HTML */
var raw_html = '...';
uncss(raw_html, options, function (error, output) {
    console.log(output);
});

There’s no arguing that years of maintaining, adding, and removing from a site will add excess code to the codebase.  That excess code comes at the cost of users who have load the extra code, so eliminating the dead code is important.  Give uncss a try — it’s an easy to use, automated helper to keep your codebase as tight as possible!

Read the full article at: uncss: Find Unused CSS

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "CSS, Node.js"
Comments Send by mail Print  Save  Delicious 
Date: Tuesday, 01 Apr 2014 11:34

Every once in a while I want to open a website from the terminal … just because.  Maybe it’s because it makes me feel just a bit more hardcore, you know, not clicking a GUI icon.  Anyways, opening a browser via the command line is dead simple:

open http://davidwalsh.name

That execution will open the URL in the system’s default browser.  If your prefer a specific browser, you can so specify:

open -a "Google Chrome Canary" http://cnn.com

Open a URL from the command line — you’ll feel like a true pro.

Read the full article at: How to Open a Website from Terminal

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "Quick Tips, Shell"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 31 Mar 2014 13:51

Google Analytics and its API is a beacon of awesomeness and immense stat tracking power, but for the longest time I was using some of its features, like event tracking, and simply taking Google’s word for it that things were working correctly.  Of course none of this tracking was mission critical, I simply wanted to experiment.  If only I had known about ga_debug.js; this alternate file provides loads of debug information while you push information to _gaq.  Here’s how I’ve implemented ga_debug.js:

(function(a, d) {
    // Do we load the real analytics or debug analytics?
    // The debug file is available at:  https://ssl.google-analytics.com/u/ga_debug.js
    var analyticsPath = config.isDebug ? 'u/ga_debug.js' : 'ga.js';

    // Output your account, of course
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'MY_ACCOUNT_ID'],

    var ga = d.createElement(a); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == d.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/' + analyticsPath;
    var s = d.getElementsByTagName(a)[0]; s.parentNode.insertBefore(ga, s);
  })('script', document);

You’ll notice that ga_debug is at a deeper path.  You’ll also know I switch that flag on the client side; of course you can do the live or debug file logic with client side code.  So what can you see by loading this alternate file?  Here’s a sample:

_gaq.push processing "_setAccount" for args: "[MY_ACCOUNT_ID]": 
_gaq.push processing "_setAllowAnchor" for args: "[true]": 
_gaq.push processing "_setCustomVar" for args: "[8,docs navigator,Yes,1]": 
_gaq.push processing "_trackPageview" for args: "[]": 
Track Pageview
Tracking beacon sent!
utmwv=5.4.8d&utms=1&utmn=1975439136&utmhn=davidwalsh.name&utme=8(7!Signed-In*docs%20navigator*Beta%20Tester)9(7!Yes*Yes*Yes)11(7!1*1*1)&utmcs=UTF-8&utmsr=1440x900&utmvp=1437x728&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=13.0%20r0&utmdt=Mozilla%20Developer%20Network&utmhid=611097861&utmr=-&utmp=%2Fen-US%2F&utmht=1396054748895&utmac=UA-36116321-5&utmcc=__utma%3D262314265.242604067.1395793245.1395837640.1396054749.5%3B%2B__utmz%3D262314265.1395793245.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B&utmu=qS~
Account ID               : MY_ACCOUNT_ID
Page Title               : David Walsh Blog
Host Name                : davidwalsh.name
Page                     : /en-US/
Referring URL            : -
Hit ID                   : 611097861
Visitor ID               : 242604067
Session Count            : 5
Session Time - First     : Tue Mar 25 2014 19:20:45 GMT-0500 (CDT)
Session Time - Last      : Wed Mar 26 2014 07:40:40 GMT-0500 (CDT)
Session Time - Current   : Fri Mar 28 2014 19:59:09 GMT-0500 (CDT)
Campaign Time            : Tue Mar 25 2014 19:20:45 GMT-0500 (CDT)
Campaign Session         : 1
Campaign Count           : 1
Campaign Source          : (direct)
Campaign Medium          : (none);
Campaign Name            : (direct)
Custom Var 7             : label:'Signed-In' value:'Yes' scope:'1'
Custom Var 8             : label:'docs navigator' value:'Yes' scope:'1'
Custom Var 9             : label:'Beta Tester' value:'Yes' scope:'1'
Language                 : en-us
Encoding                 : UTF-8
Flash Version            : 13.0 r0
Java Enabled             : true
Screen Resolution        : 1440x900
Browser Size             : 1437x728
Color Depth              : 24-bit
Ga.js Version            : 5.4.8d
Cachebuster              : 1975439136

Upon each push call, analytics spits out the information you’ve sent along with your user and browser information.  Essentially ga_debug.js provides you a plethora of information and peace of mind that your analytics calls are working!

Read the full article at: Google Analytics Debugging with ga_debug.js

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "Google, JavaScript"
Comments Send by mail Print  Save  Delicious 
Date: Friday, 28 Mar 2014 01:00

Velocity Conference

Alright conference-lovers:  I’ve got something awesome for you.  O’Reilly’s Velocity Conference 2014 is coming up on June 24th-26th in Santa Clara, CA, USA and if you can go, you probably should.  Check out the list of speakers you’ll see over those few days:

  • Lara Swanson – Etsy Developer Boss
  • Pamela Fox – Kahn Academy
  • Stoyan Stefanov - Facebook
  • Jeff Dean – Google
  • Ilya Grigorik – Google
  • Tammy Everts – Radware
  • …and many more!

You can even build your own agenda or check out a list of featured tutorials!

Conference Passes Giveaway!

I have two glorious, shiny, and rare golden tickets to Velocity Conference 2014 that I’m dying to give away.  Want to win one?  I could just say that you need to leave your name and email in a comment but that’s far too easy — I want something out of this too.  In addition to leaving your real name and real email address, I want you to share one client side speed tip you’ve used to speed up your sites.  Bonus points for including a code sample, and massive bonus points for a link to a bonus test!

Hint hint:  the more you provide, the better chance you have to go!

20% Conference Discount Code:  WALSH20

If you don’t end up winning or want to get your registration in early, you can use the WALSH20discount code to get 20% off of your registration fee.  That’s a good amount to put toward travel, food, drinks, or bribing one of the speakers to get you a job!

Good luck everyone!  I can’t wait to be the Willy Wonka to these golden tickets!  Show me the perf!

Read the full article at: O’Reilly Velocity Conference: Discount Code and 2 Free Passes!

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "Giveaways"
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 27 Mar 2014 20:17

I like using edge browsers each day so that I’m aware of what features my website visitors will be seeing down the road, and to get an early glimpse at new browser and API features.  I prefer to do my basic browsing in Chrome Canary and my developing in Firefox Nightly.  Since I do more browsing than developing (i.e. checking email, researching coding techniques, writing, etc.), I wanted to make Chrome Canary my default browser, but when I click the button to do so, nothing happens.  WTF?!

Well, there’s a way to make it happen…but you need to use Safari to do it.  How’s that for a hack?!

Safari Preferences

Safari’s preferences pane has a “Default Web Browser” dropdown for which you can set the default browser.  Each of the browsers you have on your system will display in the dropdown.  Going to another browser to set a different browser as the default?!  Whatever, it works.

Read the full article at: Set Chrome Canary as the Default Browser in OS X

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "Browsers, Google, Quick Tips"
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 27 Mar 2014 01:17

Fans of AMD JavaScript will probably tell you that they love loading only what they need, when they need them.  I am one of those people.  Let’s take a site like mine for example: some pages require a syntax highlighter, some do not.  Why make the effort to load the syntax highlighter CSS and JavaScript if there are no pre elements that would require it?

The following is an example of how I occasionally load resources based on DOM contents:

$('article pre').length && (function() {
        var mediaPath = '/assets/';

        $('').attr({
            type: 'text/css',
            rel: 'stylesheet',
            href: mediaPath + 'css/syntax.css'
        }).appendTo(document.head);

        var syntaxScript = document.createElement('script');
        syntaxScript.async = 'true';
        syntaxScript.src = mediaPath + 'js/syntax.js';
        doc.body.appendChild(syntaxScript);
    })();

The arguments against this practice will be (1) concatenating into existing JS and CSS to save on the number of requests and (2) flash of content style changes.  The first argument needs to be judged on a per-case basis;  if the required CSS and JS is small, it should be concatenated to a file used throughout the site or site subsection.  The second argument can always be hushed with a bit of transition magic!

Read the full article at: Lazy Load Resources Based on Element Presence

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "CSS, JavaScript, Quick Tips"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 24 Mar 2014 22:33

I’ve never been a massive Microsoft fan but one thing I believe they got massively right was Xbox.  I didn’t own the first Xbox but I did jump at the Xbox 360 and love it.  When I saw that Xbox One was coming out, I bought one right away.  Not with the giddy feeling I had when I was a kid, but with the attitude that this one would be superior in graphics, apps, and such.  Here are my thoughts so far.

Disclaimer:  I’m an ancient 30 years old.  In my life I’ve owned a Nintendo (awesome), Nintendo 64 (best gaming machine ever, bar none), Sega Genesis (OK), GameCube (meh), wii (novelty was cool for a while), and now the Xbox One.  I’ve never liked Playstation.  As an adult, I’ve owned every Call of Duty game and prefer “realistic” first person shooters, though I do love Portal.  I don’t expect my gaming machines to “do everything”, like browse internet, have apps, etc. — those are nice “add ons.”

  • My initial feeling was underwhelmed.  I guess I didn’t expect much of an advancement, mostly because the Xbox 360 was maintained so well, but I guess I was just hoping for more.  Maybe it was the “metro” design that put me off?
  • I recently tried to play a game I bought (via disc) and the would attempt to boot up but then quit.  After research I found out that it was a memory issue and that I needed to (no joke) unplug the machine and plug it back in.  What the hell.  it’s like the 2014 version of “blowing on the cartridge”.
  • The performance and graphics of the games I have played are top notch — I’ve never had an issue.  Bravo there.
  • I’m happy that the controller layout hasn’t changed at all.  Too often vendors change things just to justify a higher price; Microsoft didn’t do that and I’m glad, considering how much games have become muscle memory.
  • The ability to multitask is nice but if you’re playing a game that lets you multitask…what are you doing?
  • The price point of $500 dollars is fair considering it will likely be around for five years, adding to that the system comes with Kinect.  You can’t really complain about $100 per year….
  • though it is up for debate that you should need to pay for an online membership.  Of course you don’t have to play online, and it is a nice service, but it’s too bad that you have to offer up $60/year for it.
  • I was gutted when I found out that HBOgo wasn’t available as a launch app — it was super useful on my Xbox 360.  Still today the app hasn’t launched and I’m borderline mad.  I have a Roku and AppleTv for HBO, as well as a Chromecast, but somehow I’m not cool with my Xbox missing that app.
  • The Netflix app is solid, and I much prefer it to the Xbox 360′s.  The Roku’s Netflix app is still ace though.
  • The Skype app is also very solid, yet sometimes hilarious.  Every once in a while it zooms in to your face or other parts of you and it’s good for a laugh.
  • The ability to say “Xbox record that” is amazing — I’m recording my world-beating shots all the time.  Unfortunately I don’t have a damn clue how to upload them anywhere to share.  The app to do so is…not user-friendly, to say the least.
  • The Internet Explorer app defaults to “Do Not Track” — awesome!

This wasn’t meant to be an all-encompassing review, I just wanted to share my thoughts on the system after four months.  We’ll see how things improve as time goes on, especially if Microsoft abandons the “metro” design, as has been bandied about!

If you have an Xbox One or even a PS4, let me know what you think.  I’m dying to hear your experience!

Read the full article at: Thoughts on Xbox One

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "Microsoft"
Comments Send by mail Print  Save  Delicious 
Date: Sunday, 23 Mar 2014 15:20

I’ve used Mac’s for about six years now but it wasn’t until I started using Tweetdeck that I realized how awesome the [COMMAND]+[ENTER] key combination was.  Inside a textarea?  No problem – [COMMAND]+[ENTER] and the form is submitted.  What if all forms could be that way?  They can be with a little JavaScript!

The JavaScript

There are two routes to go:  adding an event listener to the form (event delegate), or applying an event listener to specific textarea elements.  The safer route is event delegation, as dynamic forms can have many textareas added at any time, but per-textarea assignments are much more efficient. Ultimately it’s up to the developer to know their form.  Here are three code samples to accomplish form submission in a variety of ways:

// Assign to individual textarea (most efficient)
myTextarea.addEventListener('keydown', function(e) {
	if(e.keyCode == 13 && e.metaKey) {
		this.form.submit();
	}
});

// Form event delegation - individual form (somewhat efficient)
form.addEventListener('keydown', function(e) {
	if(!(e.keyCode == 13 && e.metaKey)) return;

	var target = e.target;
	if(target.form) {
		target.form.submit();
	}
});

// Body event delegation - any form (least efficient)
document.body.addEventListener('keydown', function(e) {
	if(!(e.keyCode == 13 && e.metaKey)) return;

	var target = e.target;
	if(target.form) {
		target.form.submit();
	}
});


Tweetdeck uses [COMMAND]+[ENTER] as does GitHub on some of their forms.  I’ve naturally started checking for this key command combo instead of tabbing to a field which will submit the form via traditional [ENTER] key.

Read the full article at: Command + Enter to Submit Forms

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "JavaScript"
Comments Send by mail Print  Save  Delicious 
Date: Wednesday, 19 Mar 2014 20:28

Ensuring that a website or web app is both accessible and usable, as well as functional, is paramount to a positive user experience for all users.  Users don’t appreciate when we’ve done a good job, but they definitely know when we’ve done poorly.  One important part of app usability and accessibility is focus management, a task often overlooked by developers.

A prime example of poor focus management:  opening a modal upon clicking a triggering link, not focusing on the any element in the modal.  Even worse:  focusing on one of the modal’s elements but not returning focus to its trigger element once it has been closed.  Ideally you would store a reference to the trigger, focus into the modal, and focus back on the trigger element when the modal is closed.

What about the times when you aren’t aware of which element is focused though?  The document tells us which element is focused via the document.activeElement property!

The JavaScript

Retrieving the currently selected element is as easy as using document.activeElement:

var focusedElement = document.activeElement;

/* per my example:
	var triggerElement = document.activeElement;
	myModal = new MyModal({
		onOpen: function() {
			this.container.focus();
		},
		onClose: function() {
			triggerElement.focus();
		}
	});
*/

This property isn’t simply reserved for traditionally focusable elements, like form fields and links, but also any element with a positive tabIndex set.

What I love about document.activeElement is that you don’t need any type of event listener or delegated listener to keep track of what element is focused — you can simply reference that one property at any time.  Of course you should do loads of testing before relying on a feature like this — it seems ripe for cross-browser issues or race conditions.  All in all, however, I’ve been pleased with my use of it and its reliability!

Read the full article at: Get the Focused Element with JavaScript

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "JavaScript"
Comments Send by mail Print  Save  Delicious 
Date: Tuesday, 18 Mar 2014 13:20

Almost every HTML element we create is thought of in the frame of horizontal.  We pay much more attention to widths than we do heights, especially when it comes to text within them. Sometimes we do, however, want to display element text in a vertical fashion.  In the old days of crippled Internet Explorers, this was mostly a losing battle.  These days, however, vertical text is a breeze.  Here’s how to do it!

The CSS

Vertical text is accomplished easily these days with CSS transforms:

.vertical-text {
	transform: rotate(90deg);
	transform-origin: left top 0;
}

Depending on which direction you’d like the text to display vertically, the rotation will be different, but it’s that rotate value which will make the text vertical.  Here’s a helpful tip:

.vertical-text {
	float: left;
}

Floating the element will essentially emulate an auto width!

CSS transforms make loads possible, and are much more powerful than simply turning text vertical, but with the code provided above, the job is done.  Isn’t progress grand?

Read the full article at: CSS Vertical Text

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "CSS"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 17 Mar 2014 02:16

Oftentimes I’ll want to copy the output of a shell command execution but can’t get the whole output because it’s larger than the terminal’s buffer length, so I’ll need to write to file for easy viewing, or I’ll simply be annoyed that I have to click-hold-drag to copy the output.  Shouldn’t there be an easier way?  There is:  pbcopy and clip.  Using pbcopy within the shell, the output of an execution can automatically be added to the copy queue (or clipboard):

# Copy the source of davidwalsh.name to the clipboard on Mac
curl davidwalsh.name | pbcopy

# Copy the source of davidwalsh.name to the clipboard on Mac
curl davidwalsh.name | clip

Piping pbcopy at the end of the command makes this magic possible.  So what do I look forward to using this for?  My colleague Luke showed me how he gets the commit hash from the master branch without needing to go to GitHub to get it:

alias ghash='git rev-parse HEAD && git rev-parse HEAD | pbcopy'

I look forward to using pbcopy more — an excellent utility to allow me to avoid lame cursor click-hold-drag to get the output I want!

Read the full article at: Copy Shell Output via the Command Line

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "Shell"
Comments Send by mail Print  Save  Delicious 
Date: Wednesday, 12 Mar 2014 22:20

Get a pack of 19 premium resources worth $66 for free by entering this contest. The free pack is sent to the email address you use to participate in the competition and comes from the New Colossal Bundle: $10,063 worth of Top-Quality Resources — From $49. This way, you can test the products before you actually win them.

giveaway

About Inky Deals

Inky Deals is one of the leading deals websites in the design community, with an extended family of more than 300,000 design enthusiasts. It’s the place to go if you want to buy premium resources at unbeatable prices, whether you’re a graphic or web designer, developer, or business owner looking to improve yourself and your work. They’re the only ones who offer a 200% money back guarantee on every product. This means that if you’re not happy with it, you get your money back and you also get to keep the product.

Because Inky (the lovable little ink blob) and his team enjoy giving back to the community, they’ve launched this unique giveaway where you can win 1 of the 5 New Colossal Bundles: $10,063 worth of Top-Quality Resources — From $49. Take advantage of this opportunity to win a fresh, premium personal library of design resources for 2014!

Testimonials

testimonials

What can you win?

Get a pack of 19 premium resources worth $66 for free by entering this contest. The free pack is sent to the email address you use to participate in the competition and comes from the New Colossal Bundle: $10,063 worth of Top-Quality Resources — From $49. This way, you can test the products before you actually win them.

preview

5 lucky winners will be chosen from the list of participants and each of them will win a free copy of the New Colossal Bundle: $10,063 worth of Top-Quality Resources — From $49.

preview

How to enter the giveaway:

To enter the giveaway, please use the widget below. You can gain more entries by leaving a comment, tweeting about the giveaway and sharing it with your friends. a Rafflecopter giveaway

Thank you for participating, you’re now part of Inky’s extended design family! Sit tight, because you’ve just embarked alongside 300,000 of your peers on a journey that will lead you to great professional and personal development.

Read the full article at: Giveaway: Win 5 New Colossal Bundles Value $10,063 from Inky Deals

Treehouse

Sencha Touch Mobile Framework

Author: "David Walsh" Tags: "Sponsored"
Comments Send by mail Print  Save  Delicious 
Date: Wednesday, 12 Mar 2014 15:06

Everyone knows that Amazon S3 is great for storing files. It’s fast, inexpensive, and easy to setup. What you may not realize is that you can also host static websites on this robust platform.

What is a static website? In short, it’s a website comprised of only HTML, CSS, and/or JavaScript. That means server-side scripts aren’t supported, so if you want to host a Rails or PHP app, you’ll need to look elsewhere. For simpler purposes, welcome to the wonderful world of hosting websites on S3!

Creating a Bucket

If you don’t already have one, the first thing you’ll need to do is sign up for an Amazon Web Services (AWS) account. It doesn’t cost anything to sign up, but keep in mind you will need to pay for storage and transfer fees once you start putting objects on S3. (Don’t worry, it’s cheap!)

Once you create an account, you’ll have access to the AWS Management Console.

The AWS Management Console

This is where you’ll go to create your first bucket. A bucket is similar to a folder on your hard drive, except it’s in the cloud and it has virtually unlimited storage. There are a few things you need to know about buckets before creating one:

  • Bucket names need to be unique across the entire S3 platform
  • You can create a bucket in one of many supported regions around the world
  • If you want to use a custom domain, your bucket name will need to be the same as your domain name

To create a bucket, navigate to S3 in the AWS Management Console and hit Create Bucket. You’ll be prompted to enter a name and a region.

Creating a bucket in the AWS console

If you plan on using your own domain/subdomain, use that for your bucket name. For the region, pick the one closest to you and hit Create. With any luck, you’ll see your new bucket appear in the console.

Viewing your bucket in the AWS console

The only thing left to do is enable Static Website Hosting. Just select it from the panel on the right.

Static Website Hosting settings in the AWS console

Make sure you set the Index Document to index.html. You can also set an error page if you want. When you’re done, hit Save.

Well, that was easy. Now let’s upload the homepage!

Uploading Your First Page

One nice thing about the AWS Management Console is that you can upload files to your bucket right from your browser. Let’s start by creating one called index.html. This will be the contents of the homepage:

<!doctype html>
<html>
<head>
    <title>Hello, S3!</title>
    <meta name="description" content="My first S3 website">
    <meta charset="utf-8">
</head>
<body>

    <h1>My first S3 website</h1>
    <p>I can't believe it was that easy!</p>

</body>
</html>

To upload it, select your new bucket and hit Upload.

Uploading a file in the AWS console

Once you’ve uploaded index.html, it will appear in your bucket. However, you won’t be able to see it in your browser yet because everything in S3 is private by default.

To make it public, right-click on index.html and select Make Public. (Remember to do this for any other files you upload to your website!)

Now that your homepage is visible to the world, it’s time to test everything out! Select index.html in the console and go to the Properties tab.

Getting the link to your file in the AWS console

Clicking the link will take you to your new homepage.

Homepage Preview

You’ll notice that the address bar shows s3.amazon.com. This is the default URL for objects stored on Amazon S3. Let’s setup a custom domain and really turn this into a website.

Using Your Own Domain

If your bucket name is the same as your domain/subdomain name, you can point it to your new website by creating a CNAME record in your domain’s DNS settings. It should look something like this:

Domain: example.com
Type: CNAME
Target: s3.amazonaws.com.

Remember to replace example.com with your own domain. After the DNS propagates (which could take up to 24 hours), you should be able to see your website by visiting the domain in a browser. If it doesn’t show up, make sure your bucket name is exactly the same as your domain/subdomain and double check your DNS settings.

How to Edit Your S3 Website

Now that your website is up and running, you’ll probably want to make changes to it. Alas, you can’t install something like WordPress on Amazon S3. So how do you manage content?

Shameless plug: I recommend Surreal CMS. It links up to just about any site using FTP, SFTP, or Amazon S3 and it’s dead simple to integrate. Take that homepage, for example. Let’s make the entire thing editable:

<!doctype html>
<html>
<head>
    <title>Hello, S3!</title>
    <meta name="description" content="My first S3 website">
    <meta charset="utf-8">
</head>
<body>

    <div id="content" class="editable">
        <h1>My first S3 website</h1>
        <p>I can't believe it was that easy!</p>
    </div>

</body>
</html>

Notice how I’ve wrapped the content in a <div> and given it a class called editable? That pretty much sums up the integration process. You can make just about any HTML element editable this way.

Setting Up Surreal

Adding Your Site

Start by creating an account. The first thing you’ll see once you’re in Surreal CMS is the sites page.

Surreal CMS sites page

Select Add a New Site and you’ll be taken to a form that asks for some information.

Adding a site in Surreal CMS

Enter your website’s URL. Make sure you change the protocol to Amazon S3 and pick the correct region, otherwise Surreal won’t be able to connect. You’ll also need to enter your access key and secret key. If you don’t have these handy, you can get them from the Security Credentials page in the AWS Management console. For added security, consider creating a separate access key just for this purpose.

Once you’re finished, hit Submit and your site will appear in Surreal.

Enabling Pages

The next step is to enable your homepage for editing. Select your site and hit the Enable Pages button. A dialog will appear showing you the contents of your S3 bucket. Select index.html and then hit Done.

Congrats, you’re ready to start editing!

Editing Pages

Remember how you added that editable class to the homepage earlier? Well, you’re about to see why. The glorious thing about Surreal is that you’ll be editing your page inline, just like it appears in the wild. Select it from the list and you’ll be taken straight to the Live Editor.

The Live Editor in Surreal CMS

Of course, you can make any changes you want in the editor—all the usual options are available. When you’re done, go to Save > Publish and Surreal will save it to Amazon S3 for you!

Extras

Surreal also has a bunch of other great features that you’ll find useful. To name a few:

  • Inline editing
  • Responsive UI
  • Photo gallery editor
  • Google Analytics dashboard
  • Scheduled publishing
  • Change notifications
  • White-label support

While it isn’t free, you can signup for a free trial and get a full month to play around with it. I may be biased, but it’s definitely worth checking out ;)

And there you have it. Now you know how to setup a website on Amazon S3 and edit it with minimal effort. If you have questions, leave them in the comments. If you enjoyed this tutorial, let me know!

Read the full article at: Hosting a Website on Amazon S3

Treehouse

Sencha Touch Mobile Framework

Author: "Cory LaViska" Tags: "Guest Blogger, Hosting / Domain"
Comments Send by mail Print  Save  Delicious 
Next page
» You can also retrieve older items : Read
» © All content and copyrights belong to their respective authors.«
» © FeedShow - Online RSS Feeds Reader