Skip to content

Instantly share code, notes, and snippets.

View timonwong's full-sized avatar
😶

Timon Wong timonwong

😶
View GitHub Profile
@timonwong
timonwong / github.css
Created October 10, 2012 02:10 — forked from KOBA789/github.css
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@timonwong
timonwong / markdown.css
Created October 10, 2012 03:25 — forked from leecade/markdown.css
github的markdown的样式
.markdown-body {
font-size: 14px;
line-height: 1.6;
}
.markdown-body > *:first-child {
margin-top: 0 !important;
}
.markdown-body > *:last-child {
margin-bottom: 0 !important;
}
@timonwong
timonwong / gist:3898242
Created October 16, 2012 09:18
GIT: Push branches as well as tags
[remote "origin"] # Or whatever
push = :
push = +refs/tags/*:refs/tags/*
@timonwong
timonwong / gist:3944850
Created October 24, 2012 08:37
msysgit "Git Bash Here" for directory background of explorer
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\git_shell]
@="Git Ba&sh Here"
; Change the directory, if necessary
"Icon"="F:\\Program Files (x86)\\Git\\etc\\git.ico"
[HKEY_CLASSES_ROOT\Directory\Background\shell\git_shell\command]
; Change the directory, if necessary
@="wscript \"F:\\Program Files (x86)\\Git\\Git Bash.vbs\" \"%v\""
@timonwong
timonwong / novice_killer.user.js
Last active October 13, 2015 09:37 — forked from lyricat/novice_killer.user.js
干掉V2EX上所有使用默认头像用户的发言。
// ==UserScript==
// @name v2ex novice killer
// @namespace http://shellex.info
// @author shellex(5h3ll3x@gmail.com)
// @description 干掉使用默认头像的人的发言
// @include http://www.v2ex.com/go/*
// @include http://v2ex.com/go/*
// @include http://www.v2ex.com/?tab=*
// @include http://v2ex.com/?tab=*
// @include http://www.v2ex.com/
@timonwong
timonwong / gist:4671209
Created January 30, 2013 06:35
ST2: Missing C# .tmPreferences file for comments
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.cs</string>
<key>settings</key>
<dict>
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
name.txt
O Efeito do Verão.mp3
"""
name = open('name.txt').read().strip()
#!/bin/sh
./configure \
--prefix=$PREFIX \
--build-suffix=-gd \
--enable-memalign-hack \
--enable-runtime-cpudetect \
--enable-shared \
--disable-static \
--disable-debug \
diff -urN --strip-trailing-cr libao-1.1.0-orig/configure libao-1.1.0-gd/configure
--- libao-1.1.0-orig/configure 2011-02-23 00:30:22 +0800
+++ libao-1.1.0-gd/configure 2013-05-12 08:53:47 +0800
@@ -173,6 +173,14 @@
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+
+ test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
@timonwong
timonwong / naive_mem_pool.cc
Created July 30, 2013 02:06
弱爆的内存池实现
// g++ -std=c++11
#include <cstdio>
#include <new>
#include <vector>
using std::size_t;
using std::vector;
using std::bad_alloc;
// 固定大小内存池, 非常基本的演示