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
| node_modules |
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
| var Promise = require('bluebird'); | |
| var promiseWhile = function(condition, action) { | |
| var resolver = Promise.defer(); | |
| var loop = function() { | |
| if (!condition()) return resolver.resolve(); | |
| return Promise.cast(action()) | |
| .then(loop) | |
| .catch(resolver.reject); |
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
| var _ = require('lodash'); | |
| // Helper function for generating the nth Fibonacci number | |
| var fibonacci = _.memoize(function(n) { | |
| return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); | |
| }); | |
| var fibonacci_ratio = function(n) { | |
| return fibonacci(n) / fibonacci(n - 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
| $form_id = "test1234"; | |
| $form = array('nthnth' => "NNnthnthnt"); | |
| $form_state = array('sntssss' => "NTHNTHNTHNTH"); | |
| form_set_cache($form_id, $form, $form_state); | |
| watchdog('vcache', 'Cache about to be called!'); | |
| cache_set('form_' . $form_id, $form, 'cache_form', time()); |
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
| on alfred_script(q) | |
| set tmp to splitString(q, " ") | |
| set q to item 1 of tmp | |
| if length of tmp is 2 then | |
| set change to item 2 of tmp | |
| else | |
| set change to 10 | |
| end if | |
| set current to output volume of (get volume settings) |
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
| javascript:(function(){ | |
| /* Bookmarklet for viewing source in iPad Safari */ | |
| var pageHTML = document.documentElement.innerHTML; | |
| var otherlib = false; | |
| var jQueryLoaded = false; | |
| document.documentElement.innerHTML = '<!DOCTYPE html><html><head><title>Source of ' + location.href + '</title><meta name="viewport" content="width=device-width" /></head><body><div id="editor" style="height:' + window.innerHeight + 'px;width:' + window.innerWidth + 'px;"></div></body></html>'; | |
| /* Load jQuery */ | |
| if(typeof jQuery != 'undefined') { | |
| console.log('This page already using jQuery v' + jQuery.fn.jquery); |
NewerOlder