Sometimes a project can get to a point where there are so many local branches that deleting them one by one is too tedious. This one-liner can help:
$ git branch --merged master | grep -v master | xargs git branch -d
# corelib.mixin.comment | |
# -*- coding: UTF-8 -*- | |
from datetime import datetime | |
from MySQLdb import IntegrityError, OperationalError | |
from corelib.config import DOUBAN | |
from corelib.sqlstore import store | |
from corelib.mc import mc, cache, pcache | |
from corelib.accounts.public import Account |
#!/bin/bash | |
default_user="vpn" | |
default_password="123456" | |
read -p "Input VPN username:(default is ${default_user})" user | |
read -p "Input VPN password:(default is ${default_password})" password | |
if [ $user=="" ];then | |
user=$default_user |
#! coding=utf8 | |
import xlrd | |
from xlutils.copy import copy | |
def update_data(): | |
file_xls = xlrd.open_workbook("sap.xlsx") | |
w = copy(file_xls) | |
sheet_to_write = w.get_sheet(0) |
# wsgi app | |
def application(environ, start_response): | |
response_body = ''' | |
<h1>Hello World</h1> | |
<p>This is a simple test for wsgi</p> | |
<p>wsgi need two parameter: environ, start_response</p> |
#coding:utf-8 | |
from gevent import monkey | |
monkey.patch_all() | |
import logging | |
import gevent | |
import datetime | |
logging.basicConfig(level=logging.DEBUG) | |
LOGGER = logging.getLogger("GeventCelery") |
data = [ | |
{ | |
"id": 1, | |
"parent_id": None, | |
}, | |
{ | |
"id": 2, | |
"parent_id": None, | |
}, | |
{ |
#! coding=utf-8 | |
''' | |
抓取下吴军老师的知乎专栏 | |
''' | |
from __future__ import unicode_literals | |
import uuid | |
import urlparse | |
from time import sleep | |
import requests |
''' | |
To get caller info | |
''' | |
import traceback | |
def func(x): | |
print "result: %s" % x | |
stack = traceback.extract_stack() | |
print "where i am" |
#!/bin/bash | |
echo " = = = = = back up start @ `date` = = = = = " | |
BACKUP_DIR="/opt/data/backup" | |
DUMP_CMD="/usr/bin/mysqldump" | |
HOST="127.0.0.1" | |
PORT="3306" | |
USER="root" | |
PASSWORD="123456" | |
cd $BACKUP_DIR | |
TIMESTAMP=`date +%F-%H%M` |