Skip to content

Instantly share code, notes, and snippets.

View scratcher28's full-sized avatar

scratcher28

  • Russia
View GitHub Profile
// PhantomJS Cheatsheet
$ brew update && brew install phantomjs // install PhantomJS with brew
phantom.exit();
var page = require('webpage').create();
page.open('http://example.com', function() {});
page.evaluate(function() { return document.title; });
{
"indent" : {
"value": " ",
"ArrayExpression": 1,
"AssignmentExpression": 1,
"BinaryExpression": 1,
"ConditionalExpression": 1,
"CallExpression": 1,
"CatchClause": 1,
"ConditionalExpression": 1,
@scratcher28
scratcher28 / jquery.whenAll.js
Created July 28, 2011 15:52 — forked from maxim-grishaev/jquery.whenAll.js
Simple plugin for jQuery to flexibly manage $.Deferred objects. Adds possibility to push your Deferreds to stack after it's creation
(function($, undefined){
var when = $.when,
slice = window.Array.prototype.slice;
$.whenAll = function(){
var mainDfrd = $.Deferred(),
promise = mainDfrd.promise();
promise.resolved = 0;
promise.rejected = 0;
promise.total = 0;
promise.push = function(){