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
# ╭───────────────────── Mins | |
# │ ╭───────────────── Hours | |
# │ │ ╭───────────── Day of month | |
# │ │ │ ╭───────── Month (0-12) | |
# │ │ │ │ ╭───── Day of week (0-7, 0 and 7 are Sunday) | |
# │ │ │ │ │ | |
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
#!/usr/bin/env node | |
// To use: | |
// npm install object-hash | |
// | |
var Hash = require('object-hash'); | |
var Data = require('.'); |
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 a = require('./module1'); | |
var b = require('./module2'); | |
// import a from './module1'; | |
// import b from './module2'; | |
console.log('a',a); | |
console.log('b',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
// Shim console.log for IE9 when not run in with developer tools opened | |
// Stores log messages in window.consoleLog so you can retreive them when you open the tools. | |
(function () { | |
/*global window */ | |
if (!window.console) { | |
window.consoleLog = []; | |
window.console = { | |
log: function (msg) { | |
window.consoleLog.push([msg, (new Date()).toIsoString()]); | |
} |
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
/** | |
* Average an array | |
* | |
* I can't belive this isn't built in to PHP. | |
* | |
* @param float[] $array | |
* @return float | |
*/ | |
function array_average($array) { | |
return array_sum($array) / count($array); |
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
# Android | |
platforms/android/assets/www | |
platforms/android/bin/ | |
platforms/android/gen/ | |
platforms/android/res/xml/config.xml | |
# iOS | |
platforms/ios/build/ | |
platforms/ios/CordovaLib/build/ | |
platforms/ios/www |
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
$ cd /home/ubuntu/.phpenv/versions/ | |
$ for i in *; do echo; echo $i; $i/bin/php ~/test.php ; done | |
5.3.10 | |
PHP Fatal error: Class 'IntlDateFormatter' not found in /home/ubuntu/test.php on line 2 | |
Fatal error: Class 'IntlDateFormatter' not found in /home/ubuntu/test.php on line 2 | |
5.3.20 | |
PHP Deprecated: IntlDateFormatter::setTimeZoneId(): Use datefmt_set_timezone() instead, which also accepts a plain time zone identifier and for which this function is now an alias in /home/ubuntu/test.php on line 3 |
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
/** | |
* Deferred wrapper around setTimeout. Lets you do: | |
* $.delay(100).then(function () { | |
* // some delayed action | |
* }); | |
* @param time Delay time in ms. | |
* @return Deferred a promise that will complete after the time | |
*/ | |
jQuery.delay = function (time) { | |
var dfr = jQuery.Deferred(); |
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
def memoize(f): | |
cache= {} | |
def memf(*x): | |
if x not in cache: | |
cache[x] = f(*x) | |
return cache[x] | |
return memf | |
@memoize | |
def sum_factors(x): |