One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
import sys | |
import sqlalchemy as sa | |
from sqlalchemy.exc import IntegrityError | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import sessionmaker | |
base = declarative_base() | |
print 'SQLAlchemy version {}'.format(sa.__version__) |
#!/usr/bin/env python | |
# coding: utf-8 | |
from os import system | |
PROJECT_PATH = 'path_to_your_project' | |
ACTIVATE_VENV = '. path_to_your_virtualenv/bin/activate' | |
def tmux(command): |
import sys,os | |
import curses | |
def draw_menu(stdscr): | |
k = 0 | |
cursor_x = 0 | |
cursor_y = 0 | |
# Clear and refresh the screen for a blank canvas | |
stdscr.clear() |
import two1.lib.bitcoin as bitcoin | |
from two1.lib.wallet import Wallet | |
wallet = Wallet() | |
# Collect public keys | |
p1_pubkey = wallet.get_payout_public_key() | |
p2_pubkey = wallet.get_change_public_key() | |
# Build multisig redeem script |
class MyTask(luigi.Task): | |
def complete(self): | |
def _get_last(outputs): | |
last = 0.0 | |
for item in outputs: | |
if not item.exists(): | |
continue | |
current = os.path.getmtime(item.path) | |
if current > last: | |
last = current |
if __name__ == "__main__": | |
stock_watcher = Observable() | |
american_observer = AmericanStockMarket() | |
stock_watcher.register(american_observer) | |
stock_watcher.publish('KLSE Market Update', price='+0.5') |
''' | |
A python script which starts celery worker and auto reload it when any code change happens. | |
I did this because Celery worker's "--autoreload" option seems not working for a lot of people. | |
''' | |
import time | |
from watchdog.observers import Observer ##pip install watchdog | |
from watchdog.events import PatternMatchingEventHandler | |
import psutil ##pip install psutil | |
import os |
# TextMate tutorial: http://manual.macromates.com/en/language_grammars | |
# Regex to convert keys to unquoted: '(include|match|captures|begin|end|beginCaptures|endCaptures|name|patterns|0|1|2|3|4|5|6|7|8|9|comment|fileTypes|scopeName|repository|contentName|firstLineMatch|foldingStartMarker|foldingStopMarker)': | |
scopeName: 'source.<scope>' # <scope> should be a short, unique indicator for the language ("js", "php", "c", etc.) | |
name: '<name>' # The title that will show up in grammar selection and on your status bar. | |
fileTypes: [ # An array of file extensions. | |
'txt' | |
'exif' | |
] |