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
""" | |
Result: | |
TIMEZONE_CHOICES = [ | |
("Africa", [ | |
("Africa/Abidjan", "Abidjan"), | |
("Africa/Accra", "Accra"), | |
#... | |
]), | |
("America", [ |
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
describe "post tests", -> | |
post = null | |
beforeEach -> | |
#jasmine-jquery | |
#fixtures = do jasmine.getFixtures | |
#fixtures.fixturesPath = 'base/test/fixtures/' | |
#loadFixtures 'bookmark.html' | |
post = spyOn $, 'post' |
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
#-*- coding: utf-8 -*- | |
from django.forms.widgets import CheckboxInput | |
from .. import register | |
@register.filter | |
def is_checkbox(field): | |
if isinstance(field.field.widget, CheckboxInput): |
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 just a cool example on how to write coros in javascript Ecma6. | |
* Licence: MIT | |
* Author: esteban castro borsani | |
*/ | |
var http = require('http'); | |
var fs = require('fs'); | |
var path = require('path'); | |
var Q = require("q"); | |
var co = require("co"); |
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
/* | |
Author: Esteban Castro Borsani | |
Licence: MIT | |
*/ | |
/* | |
This is a schema validator... errrgh.... this is the first step to create a json validator. | |
It does not do any validation, but it iterates over nested objects and arrays defined in your schema, recording the full path for error outputs. | |
REQUIRES: lodash |
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
if __name__ == '__main__': | |
import os | |
from subprocess import call | |
BASE = os.getcwd() | |
for root, dirs, files in os.walk("./spirit"): | |
if 'locale' not in dirs: | |
continue |
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
""" | |
Before running this script: | |
* move all locale folders (en, es, pl, etc) to ./locales, these are the big (original) .po files. | |
* create a locale folder in every app, then run 'django-admin makemessages -l xx' (where xx is every language) | |
* move the project root (the one containing the apps) to ./spirit | |
* run this script | |
* you should get all the django.po translated from the original locale files (those in the ./locales folder) | |
""" |
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
""" | |
Results are in: | |
user / system / total / (real) | |
Riak multiget: | |
Riak Nodes: 5 | |
CPUs: 8 | |
Threads: 8 | |
Keys: 50 | |
Rehearsal ------------------------------------------------- |
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 contextlib import contextmanager | |
import os | |
@contextmanager | |
def pushd(new_dir): | |
prev_dir = os.getcwd() | |
os.chdir(new_dir) | |
yield | |
os.chdir(prev_dir) |
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
import hashlib | |
def get_hash(file): | |
md5 = hashlib.md5() | |
for c in file.chunks(): | |
md5.update(c) | |
return md5.hexdigest() |