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
/** | |
* replaces variables in element innerHTML, e.g. | |
* DOM: <span id="fillMe">hey {{#}}, whats up {{#}}</span> | |
* Code: document.querySelector('#fillMe').fillWith('bro') | |
* Output: hey bro, whats up bro | |
* | |
* DOM: <span id="fillMe">the {{animal}} is sitting at the {{forniture}}</span> | |
* Code: document.querySelector('#fillMe').fillWith({'animal': 'cat', 'forniture': 'table'}); | |
* Output: the cat is sitting at the table | |
*/ |
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
/** | |
* Prefixes each array element with given | |
* @param {String} prefix | |
* @usage e.g var pfixed = ["one", "two", "three"].prefixEach("number: "); | |
*/ | |
Array.prototype.prefixEach = function(prefix) { | |
return this.map(_ary(String.prototype.concat.bind(prefix))); | |
}; | |
function _ary(fn, arity) { |
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 _noop() {} | |
function _constant(v) { return function() { return v; }; } | |
/** | |
* intercept <form> and submit it via XHR | |
* @param {String} formSelector | |
* @param {Function} successCallback | |
* @param {Function} errorCallback | |
* @param {Function} beforeSubmit | |
*/ |
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/python | |
# -*- coding: utf-8 -*- | |
import datetime | |
import sys | |
def compare(dates): | |
if len(dates) < 2: |
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
/** | |
* vainilla js simple slider | |
* source: http://cssdeck.com/labs/image-slider-1 | |
*/ | |
/** | |
css: | |
.image-slider-wrapper{ | |
overflow: hidden; | |
} |
NewerOlder