This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Favicons and touch icons --> | |
<!-- For retina-display iPads --> | |
<link href="/assets/images/apple-touch-icon-xlarge.png" rel="apple-touch-icon-precomposed" sizes="144x144" type="image/png"/> | |
<!-- For retina-display iPhones --> | |
<link href="/assets/images/apple-touch-icon-large.png" rel="apple-touch-icon-precomposed" sizes="114x114" type="image/png"/> | |
<!-- For iPad 1 --> | |
<link href="/assets/images/apple-touch-icon-medium.png" rel="apple-touch-icon-precomposed" sizes="72x72" type="image/png"/> | |
<!-- For iPhone 3G, iPod Touch and Android --> | |
<link href="/assets/images/apple-touch-icon-small.png" rel="apple-touch-icon-precomposed" type="image/png"/> | |
<!-- For Nokia --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// currying example | |
function add(n) { | |
// save results | |
var r = 0; | |
// the real deal | |
function _add(n) { | |
r += n; | |
document.getElementById('r').innerHTML = r; | |
// return add interface | |
return _add; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h1 { | |
font-size: 32px | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Let's say you have collection of things, like: | |
var collection = [ | |
{name: '#1 thing', time: '2012-03-16T07:22Z'}, | |
{name: '#2 thing', time: '2012-03-15T12:00Z'}, | |
{name: '#3 thing', time: '2012-03-17T20:25Z'}, | |
{name: '#4 thing', time: '2012-03-13T13:45Z'} | |
]; | |
// the sorting function | |
function sortByDateTime(a, b) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var API = (function () { | |
// private scope | |
var API_PREFIX = 'http://api.myapp.com'; | |
// request helper | |
function _request (method, resource, data, succes, error) { | |
// use your favorite library here | |
// or just vanilla... | |
var options = { | |
url: API_PREFIX + resource, | |
type: method, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request') | |
/** | |
* Handle multiple requests at once | |
* @param urls [array] | |
* @param callback [function] | |
* @requires request module for node ( https://github.com/mikeal/request ) | |
*/ | |
var __request = function (urls, callback) { |
OlderNewer