Skip to content

Instantly share code, notes, and snippets.

View plural.js
var plural = function(number, one, two, five) {
var n = Math.abs(number);
n %= 100;
if (n >= 5 && n <= 20) return number + ' ' + five;
n %= 10;
if (n == 1) return number + ' ' + one;
if (n >= 2 && n <= 4) return number + ' ' + two;
zerc / Backbone.Form.Validators.js
Created Jun 22, 2013
Some addition validators for Backbone.Form
View Backbone.Form.Validators.js
(function (Form) {
Form.validators.errMessages = {
youtube: 'Enter link from YouTube',
positive_int: 'Enter positive integer'
}; = function(options) {
options = _.extend({
type: 'youtube',
View log_1
(venv)zero13cool@gantzer:~/repos/allinway$ cafe --nologo build --app_root=resources/cs --build_root=static/js --formula=recipe.yaml -f
Cafe> resolve: package.json's main file not found in dir /home/zero13cool/repos/allinway/resources/cs/node_modules/genome-parser/index.js
Cafe> resolve: package.json's main file not found in dir /home/zero13cool/repos/allinway/resources/cs/node_modules/dna-lang/lib-js/dna.js
Cafe> [Error: Cannot find module 'console-logger']
npm WARN package.json dna-lang@0.2.16 No repository field.
npm http GET
npm http GET
npm http GET
npm http 304
npm http 304
zerc /
Created Sep 17, 2013
Логирование трейсбека. И даже не спрашивайте зачем мне это :D
def D(fn):
import traceback
filename = 'trace'
def _(*args, **kwargs):
return fn(*args, **kwargs)
traceback.print_exc(5, open(filename, 'w'))
return _
zerc / example_git_filter_branch
Created Sep 28, 2013
Переписываем историю своего гит репозитория
View example_git_filter_branch
git filter-branch --tree-filter "find . \( -name '' -o -name '' \) -exec sed -e \"s/password/fake_password/g\" -e \"s/api_key_secret/fake_key/g\" -i {} \;" HEAD --all
View Preferences.sublime_settings
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"ensure_newline_at_eof_on_save": true,
View gist:f61441211c9ee4bd7a15
from collections import deque
import time
def timeit(method):
def timed(*args, **kw):
ts = time.time()
result = method(*args, **kw)
te = time.time()
print('{}, {}'.format(method.__name__, te-ts))
return result
zerc / free_email_provider_domains.txt
Last active Jan 18, 2016 — forked from tbrianjones/free_email_provider_domains.txt
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
View free_email_provider_domains.txt
You can’t perform that action at this time.