This file contains hidden or 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 generateUUID() { | |
var d = new Date().getTime(); | |
var uuid = 'xxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = (d + Math.random()*16)%16 | 0; | |
d = Math.floor(d/16); | |
return (c=='x' ? r : (r&0x7|0x8)).toString(16); | |
}); | |
return uuid; | |
}; |
This file contains hidden or 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 | |
if __name__ == '__main__': | |
print '\033[0;%im01234567890abcdefghijklmnopqrstuvwxyz\033[0;m' % 0, 0 | |
print '\033[0;%im01234567890abcdefghijklmnopqrstuvwxyz\033[0;m' % 1, 1 | |
print '\033[0;%im01234567890abcdefghijklmnopqrstuvwxyz\033[0;m' % 2, 2 | |
print '\033[0;%im01234567890abcdefghijklmnopqrstuvwxyz\033[0;m' % 4, 4 | |
print '\033[0;%im01234567890abcdefghijklmnopqrstuvwxyz\033[0;m' % 7, 7 | |
print '\033[0;%im01234567890abcdefghijklmnopqrstuvwxyz\033[0;m' % 8, 8 | |
print '\033[0;%im01234567890abcdefghijklmnopqrstuvwxyz\033[0;m' % 9, 9 |
This file contains hidden or 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 SimpleHTTPServer, BaseHTTPServer; server_addr = ('localhost', 8000); request_handler = SimpleHTTPServer.SimpleHTTPRequestHandler; httpd = BaseHTTPServer.HTTPServer (server_addr, request_handler); httpd.serve_forever () |
This file contains hidden or 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 calculator(expr): | |
l, o, r = expr.strip().split(' ') | |
if o == '+': | |
return eval(l) + eval(r) | |
elif o == '-': | |
return eval(l) - eval(r) | |
elif o == '*': | |
return eval(l) * eval(r) | |
elif o == '/': | |
return eval(l) / eval(r) |
This file contains hidden or 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
# Retorna dados sobre o pregão | |
http://www.bmfbovespa.com.br/Pregao-Online/ExecutaAcaoCarregarDados.asp?CodDado=IBOV,ticker&CA=undefined | |
# Retorna ações e seus últimos valores negociados | |
http://www.bmfbovespa.com.br/Pregao-OnLine/ExecutaAcaoCarregarDados.asp?CodDado=Ticker | |
# Retorna o histórico do dia de um papel | |
http://www.bmfbovespa.com.br/Pregao-Online/ExecutaAcaoCarregarDadosPapeis.asp?CodDado=petr4 | |
# Retorna dados de um papel |
This file contains hidden or 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
class ClassDecorator(object): | |
def __init__(self, models_list=None): | |
self.ml = models_list or 'models_list' | |
def __call__(self, cls): | |
class Wrapped(cls): | |
if not self.ml in globals(): | |
globals()[self.ml] = [] | |
globals()[self.ml].append(cls.__name__) | |
return Wrapped |
This file contains hidden or 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 | |
import argparse | |
from json import load, loads, dump, dumps | |
from StringIO import StringIO | |
parser = argparse.ArgumentParser(description='JSON console tools') | |
parser.add_argument('-v', '--validate', action='store_true', help='validate JSON data') | |
parser.add_argument('-l', '--inline', action='store_true', help='uglify JSON data') |
This file contains hidden or 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
#!/bin/sh | |
{ | |
echo "Install JSONTools in your environment." | |
echo "You will be prompted for your password by sudo." | |
# clear any previous sudo permission | |
sudo -k | |
# run inside sudo |
This file contains hidden or 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
python -c "import urllib, re; print re.findall(r'<a.*?>(.*?)<\/a>', urllib.urlopen('http://developerexcuses.com/').read())[0]" |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
a | |
a | |
a | |
a | |
a | |
a | |
a | |
a | |
a | |
A |