As configured in my dotfiles.
start new:
tmux
start new with session name:
class EventHook(object): | |
def __init__(self): | |
self.__handlers = [] | |
def addHandler(self, handler): | |
self.__handlers.append(handler) | |
def removeHandler(self, handler): | |
self.__handlers.remove(handler) |
As configured in my dotfiles.
start new:
tmux
start new with session name:
# -*- coding: utf-8 -*- | |
from flask import Flask | |
from sqlalchemy import SQLAlchemy | |
app.config['SQLALCHEMY_DATABASE_URI'] = "mysql+oursql://foo:bar@localhost/test1" | |
# binds multiple database definition | |
app.config['SQLALCHEMY_BINDS'] = { | |
"db1": "mysql+oursql://foo:bar@localhost/test1", |
// | |
// _oo0oo_ | |
// o8888888o | |
// 88" . "88 | |
// (| -_- |) | |
// 0\ = /0 | |
// ___/`---'\___ | |
// .' \\| |// '. | |
// / \\||| : |||// \ | |
// / _||||| -:- |||||- \ |
To remove a submodule you need to:
#!/usr/bin/env python | |
# coding: utf-8 | |
import os | |
import sys | |
import json | |
import uuid | |
import tempfile | |
from flask import Flask, request, Response, g |
I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.
So it might be really unintuitive at first but lambda functions have three states.
>>> import pytz | |
>>> | |
>>> for tz in pytz.all_timezones: | |
... print tz | |
... | |
... | |
Africa/Abidjan | |
Africa/Accra | |
Africa/Addis_Ababa | |
Africa/Algiers |
# Delete the tag on any remote before you push | |
git push origin :refs/tags/<tagname> | |
# Replace the tag to reference the most recent commit | |
git tag -fa <tagname> | |
# Push the tag to the remote origin | |
git push origin master --tags | |
# source: http://stackoverflow.com/questions/8044583/how-can-i-move-a-tag-on-a-git-branch-to-a-different-commit |
## Consumer Throughput: Single consumer thread, no compression | |
## Consumer Throughput: 3 consumer thread, no compression | |
bin/kafka-consumer-perf-test.sh --topic benchmark-3-3-none \ | |
--zookeeper kafka-zk-1:2181,kafka-zk-2:2181,kafka-zk-3:2181 \ | |
--messages 15000000 \ | |
--threads 1 |