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
sudo modprobe -r psmouse # remove mouse settings | |
sudo modprobe psmouse # re-add mouse settings | |
xinput # List touchpad devices | |
sudo xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 8 0 # Deactivate mouse settings. | |
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 datetime import datetime as dt, time | |
from random import choice | |
from time import mktime | |
start = dt.combine(dt.now().date(), time(0, 0, 0)) | |
end = dt.combine(start, time(23, 59, 59)) | |
ts = lambda t: int(mktime(t.timetuple())) | |
today = range(ts(start), ts(end)) |
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
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 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 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 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 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 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 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 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 |
OlderNewer