Skip to content

Instantly share code, notes, and snippets.

@coffeant
coffeant / ba-smallwalker.js
Created May 11, 2011 01:55 — forked from cowboy/ba-smallwalker.js
Small Walker: A small and simple JavaScript DOM walker
/*!
* Small Walker - v0.1.1 - 5/5/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
// Walk the DOM, depth-first (HTML order). Inside the callback, `this` is the
@coffeant
coffeant / gist:adcce46d6f19d915fea2
Last active August 29, 2015 14:10 — forked from chappyhome/gist:7615718
利用rsync自动同步服务器与本地代码的python脚本
菜鸟表示写web时 每次修改完后把文件往VPS上丢很麻烦
用ssh sshfs scp都太慢 小东西又懒得用git
sublimetext上得sftp不支持中文 emacs干脆就只能ssh
于是用linux自带的rsync写了个同步脚本
可以手动或自动往服务器上差异性同步 不用scp一堆东西 也不用忍受ssh那个渣速度
把脚本copy到你的目录 修改脚本内的配置 如果在脚本内设置了密码 那每次上次就会自动输入密码 否则除非你设置本地key 否则都要输密码
如果代码在服务器上 先执行 : python rsync.py -down 把代码download下来 , 个人觉得先down下来再修改 不用忍受每次load一遍 比较舒服
@coffeant
coffeant / gist:86371a8e6af89064f5cd
Created December 2, 2014 08:29
emacs -batch -l dunnet
soloved progress:
get shovel, look shovel, e, e, dig, look, get cpu, look cpu, se, get
food, se, look bear, drop food, look, get key, sw, get bracelet, ne, nw,
nw, ne, ne, ne, e, look bins, w, w, put cpu in computer, type, toukmond,
robert, ls, uncompress paper.o.Z, exit, look paper, type, ftp gamma,
anonymous, toukmond, binary, send lamp.o, send shovel.o, send key.o, send
bracelet.o, send paper.o, quit, rlogin gamma, worms, get lamp, get
shovel, get key, get bracelet, get paper, e, n, e, drop shovel, drop key,
drop bracelet, drop paper, get weight, d, drop weight, nw, u, get
@coffeant
coffeant / gist:96eb31c8b08185a75d80
Created December 17, 2014 10:35
Debugging Under Unix: gdb
Debugging Under Unix: gdb Tutorial
Contents
Introduction
Who should read this?
Source code
Preparations
Environment settings
Debugging symbols
一些词汇表
rebase 变基
pull request 拉取请求
merge 合并
repository 仓库
commit 提交
squash 压缩,挤压
另外
@coffeant
coffeant / gist:938d509dbcb1eb7788d7
Last active August 29, 2015 14:11
gdb 完全手册
https://sourceware.org/gdb/current/onlinedocs/gdb/index.html
http://translations.readthedocs.org/en/latest/hacker_howto.html
@coffeant
coffeant / .vimrc
Last active August 29, 2015 14:11 — forked from MauricioCarneiro/.vimrc
" Vundle configuration
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/vundle/ " set the runtime path to include Vundle and initialize
call vundle#begin()
" Plugins
Bundle 'gmarik/vundle'
Bundle 'Valloric/YouCompleteMe'
Bundle 'a.vim'
@coffeant
coffeant / gist:50e03cb63acc415693c5
Last active August 29, 2015 14:14
window 实现apt-get 神器之 Chocolatey
https://chocolatey.org/ [Chocolatey: A delicious Windows package manager]
1. What is Chocolatey?
Chocolatey is a command line application installer for Windows based on a developer-centric package manager called NuGet. Unlike manual installations, Chocolatey adds, updates, and uninstalls programs in the background requiring very little user interaction.
Chocolatey has its own package feed that is created and maintained by the project’s community members.
Behind the scenes, most Chocolatey packages simply download a program’s official executable and install it without any further interaction from the user.
2. How to Install?
@coffeant
coffeant / gist:2d114c3e0386723eca46
Created April 13, 2015 08:55
the subtitle of code rush
0:17lots of people
0:19and here are looking for the silicon valley experince arrive one suitcase
0:24and when they head south on the one oh one
0:27hoping to see me at this place they've heard about
0:32is freeways
0:33and its office
0:35and it's strip mall
0:38it looks like every place i've ever been random wondering where the com wanted to
0:42come here was a good price
0:47itself is the underlying