git branch calendar-branch
git filter-branch --subdirectory-filter lib/calendar calendar-branch
git tag -d 12345
git push origin :refs/tags/12345
class TestOAuth(object): | |
def setUp(self): | |
self.access_token = 'you get it' | |
def test_func1(self): | |
do_something_with(self.access_token) | |
def test_func2(self): | |
do_another_thing_with(self.access_token) |
define(function(require, exports, module) { | |
function GitHub(user) { | |
this.user = user; | |
} | |
GitHub.prototype.showRepos = function(options) { | |
options = options || {}; | |
var limit = options.limit || 10; | |
var target = options.target || document.getElementById('github-repos'); | |
if (target && target.length) target = target[0]; |
require 'formula' | |
class Nginx < Formula | |
homepage 'http://nginx.org/' | |
url 'http://nginx.org/download/nginx-1.2.1.tar.gz' | |
sha1 '4fb69411f6c3ebb5818005955a085e891e77b2d8' | |
devel do | |
url 'http://nginx.org/download/nginx-1.3.2.tar.gz' | |
sha1 'a3507cb2f13332489804f79885541c717f8f4bf0' |
def runserver(port=5000, profile_log=None): | |
"""Runs a development server.""" | |
from gevent.wsgi import WSGIServer | |
from werkzeug.serving import run_with_reloader | |
from werkzeug.debug import DebuggedApplication | |
from werkzeug.contrib.profiler import ProfilerMiddleware | |
port = int(port) | |
if profile_log: |
var data = { | |
'a': ['a1', 'a2'], | |
'a1': ['a11'], | |
'a2': [], | |
'a11': ['a111', 'a112'] | |
} | |
/* | |
* a | |
* |- a1 |
if (!process.env.NODE_PATH) { | |
console.log(); | |
if (process.env.SHELL === '/bin/zsh') { | |
console.log(' Please set environment variable NODE_PATH in ~/.zshrc:'); | |
} else if (process.env.SHELL === '/bin/bash') { | |
console.log(' Please set environment variable NODE_PATH in ~/.bashrc:'); | |
} else { | |
console.log(' Please set environment variable NODE_PATH:'); | |
} | |
console.log(); |
@manager.command | |
def sync(): | |
from june.models import db, Account, Node, Topic, NodeStatus | |
users = Account.query.all() | |
nodes = Node.query.all() | |
for user in users: | |
print('save %i %s' % (user.id, user)) | |
if not user.username: | |
username = user.email.split('@')[0] |
# coding: utf-8 | |
def fix_orientation(img): | |
orientation = img.metadata.get('exif:Orientation', 1) | |
if orientation == 1: | |
# do nothing | |
return img | |
elif orientation == 2: | |
# vertical mirror |