Skip to content

Instantly share code, notes, and snippets.

View ngn999's full-sized avatar
💭
I may be slow to respond.

ngn999 ngn999

💭
I may be slow to respond.
View GitHub Profile
@ngn999
ngn999 / gist:3888960
Created October 14, 2012 15:41
穿越分两种

穿越的电视剧,电影看多了, 来个总结, 穿越分两种:

历史是可改变的

代表作, <<回来未来>>系列, <<蝴蝶效应>>系列, <<终结者>>系列, 最近上映的<<looper>>.

这类电影一个主要的假设是: 未来人回到过去, 可以影响历史, 那当然也可以影响这个回去的人.

改变历史, 就带来了平行宇宙.

# Raw transaction API example work-through
# Send coins to a 2-of-3 multisig, then spend them.
#
# For this example, I'm using these three keypairs (public/private)
# 0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86 / 5JaTXbAUmfPYZFRwrYaALK48fN6sFJp4rHqq2QSXs8ucfpE4yQU
# 04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a986818a7cb624532f062c1d1f8722084861c5c3291ccffef4ec6874 / 5Jb7fCeh1Wtm4yBBg3q3XbT6B525i17kVhy3vMC9AqfR6FH2qGk
# 048d2455d2403e08708fc1f556002f1b6cd83f992d085097f9974ab08a28838f07896fbab08f39495e15fa6fad6edbfb1e754e35fa1c7844c41f322a1863d46213 / 5JFjmGo5Fww9p8gvx48qBYDJNAzR9pmH5S389axMtDyPT8ddqmw
# First: combine the three keys into a multisig address:
./bitcoind createmultisig 2 '["0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86","04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a9
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger ([email protected])
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@flaneur2020
flaneur2020 / sucksversion.md
Last active October 13, 2015 05:37
SucksVersioN

SucksVersioN

svn提供了比git更为精细的权限控制,按照目录为单位。

  • checkout: svn co http://svn.miaomiao.com/svn/trunk -r HEAD
  • 创建自己的分支目录:svn mkdir http://svn.foo.com/svn/branches/fleuria
  • 创建特性分支:svn cp http://svn.foo.com/svn/trunk http://svn.foo.com/svn/branches/fleuria/issue1
  • 切换分支:svn switch http://svn.foo.com/svn/branches/fleuria/issue1
  • 不像git有暂存区,svn在提交时只能将需要提交的文件列在命令里: svn commit -m 'commit message' file1.c file2.c
  • 撤销当前的所有更改: svn revert -R .

tmux cheatsheet

As configured in my dotfiles.

开启一个新的会话:

tmux

开启一个新的带名字的会话:

@flaneur2020
flaneur2020 / inline.c
Created December 8, 2012 03:53
inline.c
#include <stdio.h>
inline void i_hello() {
printf("hello\n");
}
static inline void si_hello() {
printf("static inline hello\n");
}
@gavrix
gavrix / gist:5054182
Created February 28, 2013 04:28
Script integrating OCLint into XCode. Put it in "Run script" build phase.
source ~/.bash_profile
hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
exit 1
fi
@ngn999
ngn999 / zhoubao.md
Last active December 15, 2015 07:19
周报模板
定义一个 markdown-mode下的 snippet
<pre>
# -*- mode: snippet -*-
# name: zhoubao
# key: zhoubao
# binding: C-c C-n
# --
## ${1:#你的名字#}周报
`(concat "__" (yesterday-is 1) " ~ " (tommorow-is 5) "__")`
@ngn999
ngn999 / tikz-uml-install.md
Last active December 9, 2016 21:36
how to install tikz-uml

tikz-uml都已经1.0b了, 快要正式发布了吧,哈哈. 但是安装手册还没写 :( . 在这儿补一个MacTeX下的手动安装步骤:

主要是那两个路径哈.

#!/bin/sh

mkdir -p ~/Library/texmf/tex/latex/tikz-uml/
mkdir -p ~/Library/texmf/doc/latex/tikz-uml/
@ngn999
ngn999 / gist:6242366
Last active December 21, 2015 03:28
full-ack mode的设置

有时候,就算在用git,也希望 ack时,提示的Directory是buffer所在目录。

(defun ack-pwd ()
  "return the current buffer's directory"
  (file-name-directory buffer-file-name))
(global-set-key (kbd "<f8>") 'ack)

再将ack-pwd添加到ack-root-directory-functions的第一位: