$('.awesome').show(); // Error: cannot find name `$`
declare var $:any;
$('.awesome').show(); // Okay!
declare var $:{
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 json | |
import re | |
import code | |
import pprint | |
from marshmallow import Schema | |
from marshmallow.schema import Schema | |
from marshmallow.fields import Str, Bool, Int, List, Nested, DateTime, URL | |
from werkzeug.routing import Map, Rule, NotFound, RequestRedirect | |
BASE = os.path.abspath(os.path.dirname(__file__)) |
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 csv | |
import itertools | |
def match(file, fields): | |
records = {} | |
parsed = list(csv.reader(open(file, 'rU'))) | |
columns = parsed[0] | |
indexes = {} | |
index_fields = list(itertools.chain(*[ | |
f for f in fields if type(f) == list |
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 csv | |
import itertools | |
def match(file, fields): | |
records = {} | |
parsed = list(csv.reader(open(file, 'rU'))) | |
columns = parsed[0] | |
indexes = {} | |
index_fields = list(itertools.chain(*[ | |
f for f in fields if type(f) == list |
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
+ 3000 Salary | |
- 100 Expense | |
- 200 Expense | |
- 50 Expense | |
= Group | |
- 100 Expense | |
- 200 Expense |
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/env python | |
from re import sub | |
from string import ascii_lowercase | |
from code import interact | |
from collections import defaultdict | |
from random import choice, shuffle | |
from itertools import groupby | |
VOWELS = list('aeiou') |
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
// Simple D3-based square graph generator | |
// To display accomplished pomodoros in each weekday | |
// Used in hire.jonasgalvez.com.br | |
function shuffle(array) { | |
// https://github.com/coolaj86/knuth-shuffle | |
var currentIndex = array.length, temporaryValue, randomIndex ; | |
while (0 !== currentIndex) { |
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
var deorphanize = function(text, line_length) { | |
// alert(typeof line_length) | |
if(typeof line_length == 'undefined') { | |
line_length = 40; | |
} | |
text = $.trim(text); | |
if(text.length > line_length) { | |
if(text.length < (line_length*2)) { | |
line_length = text.length/3; | |
} |
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
def print_warning(msg): | |
print fabric.colors.red("WARNING: ") + msg | |
def print_error(msg): | |
print fabric.colors.red("ERROR: ") + msg | |
def print_label(msg): | |
print fabric.colors.blue("==> ", bold=True) + msg |
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 __future__ import with_statement | |
from fabric.api import * | |
from code import interact | |
import os | |
import sys | |
import time | |
APP_ROOT = os.path.abspath(os.path.dirname(__file__)) |