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
// $('#content-with-images').imagesLoaded( myFunction ) | |
// execute a callback when all images inside a parent have loaded. | |
// needed because .load() doesn't work on cached images | |
// Useful for Masonry or Isotope, triggering dynamic layout | |
// after images have loaded: | |
// $('#content').imagesLoaded( function(){ | |
// $('#content').masonry(); | |
// }); |
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 uniq = function (arr) { | |
var i, | |
len=arr.length, | |
out=[], | |
obj={}; | |
for (i=0; i<len; i++) { | |
obj[arr[i]]=0; |
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
/* | |
* JavaScript Pretty Date (http://ejohn.org/files/pretty.js) | |
* Copyright (c) 2011 John Resig (ejohn.org) | |
* Licensed under the MIT and GPL licenses. | |
* Modified by Natan Santolo. | |
*/ | |
// Takes an ISO time and returns a string representing how | |
// long ago the date represents. | |
function prettyDate(time){ |
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) { |
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
/* Scrolling shadows by @kizmarh */ | |
html { | |
background: #FFF; | |
} | |
.scrollbox { | |
position: relative; | |
z-index: 1; |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller | |
// fixes from Paul Irish and Tino Zijdel | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; | |
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { |
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
$(function() { | |
// Depends on: jQuery, jQuery UI core & widgets (for the autocomplete method) | |
// Assumes you're already including the FB JS SDK asynchronously... | |
window.fbAsyncInit = function() { | |
FB.init({ | |
appId : 'xxxxxxxxxxxxxxxxxx', // App ID | |
status : true, // check login status |
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
#!/bin/sh | |
# | |
# chkconfig: 35 99 99 | |
# description: Node.js /home/nodejs/sample/app.js | |
# | |
. /etc/rc.d/init.d/functions | |
USER="nodejs" |
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
http { | |
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m; | |
proxy_temp_path /var/tmp; | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
gzip on; | |
gzip_comp_level 6; |
OlderNewer