This file contains hidden or 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($, 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(){ |
This file contains hidden or 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 confirm($msg, $expert='yes|y') { | |
| $input = propmt($msg); | |
| return in_array(trim($input), explode('|',$expert)); | |
| } | |
| function propmt($msg) { | |
| echo $msg; | |
| $handle = fopen("php://stdin","r"); | |
| return fgets($handle); | |
| } |
This file contains hidden or 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
| { | |
| "indent" : { | |
| "value": " ", | |
| "ArrayExpression": 1, | |
| "AssignmentExpression": 1, | |
| "BinaryExpression": 1, | |
| "ConditionalExpression": 1, | |
| "CallExpression": 1, | |
| "CatchClause": 1, | |
| "ConditionalExpression": 1, |
This file contains hidden or 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
| // 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; }); |