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
@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
@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");
}

tmux cheatsheet

As configured in my dotfiles.

开启一个新的会话:

tmux

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

@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 .
@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
# 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
@ngn999
ngn999 / gist:3888960
Created October 14, 2012 15:41
穿越分两种

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

历史是可改变的

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

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

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

@ngn999
ngn999 / gist:3863072
Created October 10, 2012 04:00
统计某一app来的query的特点
cat http2kfc.20121008  | grep tbskip |head -n 1000000 | 
perl -MURI -MList::Util -nale '$uri = new URI ("/bin/search?" . $F[-1]); 
%h = $uri->query_form; $fat= List::Util::reduce { $a . "_". $b } (keys %h); 
print $fat;'  | sort | uniq -c
@ngn999
ngn999 / gist:3791870
Created September 27, 2012 02:38
Regexp::Common

Regexp::Common

这个碉堡了!

use Regexp::Common;

if (/$RE{net}{IPv4}/){
  ...;
}
@ngn999
ngn999 / gist:3783167
Created September 25, 2012 17:03
emacs怎么全文高亮指定的字符串?

emacs自带的:
高亮匹配的字符串:M-s h p
高亮匹配字符串所在的行:M-s h l
取消高亮: M-s h u

也可以用highlight-symbol.el这个扩展。

--
smth emacs版