Skip to content

Instantly share code, notes, and snippets.

Delete all branches that are already merged into the currently checked out branch
git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d
@redswallow
redswallow / gist:6052bbaf8987dbaafba2
Created April 23, 2015 19:45
remove STUPID auto-generated song lists created by Douban
$(".songlist li").each(function(){
var pic = $(".songlist-pic", this).css("background-image");
// remove song lists with default cover only
if (pic.indexOf("cover_default") > -1) {
// get sid of the song list
var sid = $(".delete-sl-btn", this).data("sid");
$.post_withck('/j/songlist/uncollect', {
songlist_id : sid
}, function(res){
var res = $.parseJSON(res);
Cracking the coding interview, careercup
Data Structures
1. Integer
– find number of 1s
– next largest smaller
– smallest larger number
– determine if is palindrom
– itoa, atoi
Haskell code snippets
C++ code snippets
Python code snippets
##plugin
###python_fold http://www.vim.org/scripts/script.php?script_id=515
zo: 打开光标位置的折叠代码
zc: 折叠光标位置的代码
zr: 将文件中所有折叠的代码打开
zm: 将文件中所有打开的代码折叠
zR: 作用和 zr 类似,但会打开子折叠(折叠中的折叠)
zM: 作用和 zm 类似,但会关闭子折叠
zi: 折叠与打开操作之间的切换命令
@redswallow
redswallow / github-organizations.md
Last active December 15, 2016 23:51
A collection of open-source repositories of big companies.
\documentclass[12pt]{article}
\pagestyle{headings}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{dsfont}
\usepackage{graphicx}
\usepackage[paperwidth=8.5in,% %%
paperheight=11in,% %%
outer=1.1in,% %%
inner=1.1in,% %%
o 打开关闭文件或者目录
t 在标签页中打开
T 在后台标签页中打开
! 执行此文件
p 到上层目录
P 到根目录
K 到第一个节点
J 到最后一个节点
u 打开上层目录
m 显示文件系统菜单(添加、删除、移动操作)