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
from fabric.api import local | |
import sys, os, webbrowser, jinja2 | |
BASE_PATH = sys.path[0] | |
SRC_PATH = os.path.join(BASE_PATH, 'src') | |
BUILD_PATH = os.path.join(BASE_PATH, 'build') | |
JINJA_ENV = jinja2.Environment(loader=jinja2.FileSystemLoader(SRC_PATH)) | |
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
/* | |
** Execute given `func`tion no more often than once every `delay` milliseconds, | |
** queue all calls, do not drop anything (unlike throttle and debounce) | |
** | |
** Example usage: | |
** rateLimitedFunc = rateLimit(function (i) { console.log(i) }, 500) | |
** for (var i=0; i < 10; i++) rateLimitedFunc(i) | |
*/ | |
function rateLimit(func, delay) { | |
var queue = [], |
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
1. Delete unnecessary files from image | |
2. sudo yum install zerofree | |
3. reboot, edit kernel parameters, add 'rescue single ro' | |
4. remount root read-only: | |
sudo mount -r -o remount /dev/mapper/vg_centos6generic-lv_root |
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
# Need this in JavaScript? Use coffeescript.org "Try CoffeeScript" | |
# A micro DSL for building maintainable, complex, dynamic regular expressions | |
reBuild = -> | |
re = '' | |
self = { | |
# Append regular expression |
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 | |
# This fork works under Python 2.x | |
# This is script that extracts the trees of two commits to temporary | |
# directories and then runs meld on both directories, so you can compare | |
# them using meld's nice recursive browsing interface. | |
# | |
# This is for an answer to this question: |
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
py_files=`git diff --name-only HEAD|grep '.py$'` | |
grep -n 'pdb.set_trace()' $py_files && echo -e "\033[1;31m Debugger statements!!!\033[0m" && exit 1 | |
pyflakes $py_files && exit || echo -e "\033[1;31m Lint error!\033[0m" | |
exit 1 |
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
// This is a remake concept of http://ihi.im/app.js using [jtmpl](http://jtmpl.com) as only dependency | |
(function () { | |
var model = { | |
// Route: share | |
'#share': function () { | |
this.route = '#share-template' |
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
/* src: http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/ */ | |
.vcenter { | |
position: relative; | |
top: 50%; | |
-webkit-transform: translateY(-50%); | |
-ms-transform: translateY(-50%); | |
transform: translateY(-50%); | |
} |
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
/* | |
http://codereview.stackexchange.com/questions/25359/simple-trie-implementation-in-javascript | |
http://jsfiddle.net/4Yttq/9/ | |
*/ | |
function Trie(key) { |
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
### Keybase proof | |
I hereby claim: | |
* I am atmin on github. | |
* I am atmin (https://keybase.io/atmin) on keybase. | |
* I have a public key whose fingerprint is 06A7 F329 1A15 C68B 310E D752 EF90 6F97 1199 9FC9 | |
To claim this, I am signing this object: |
OlderNewer