Skip to content

Instantly share code, notes, and snippets.

View porcow's full-sized avatar
🏠
Working from home

0xNil porcow

🏠
Working from home
View GitHub Profile
@porcow
porcow / about.md
Created November 9, 2011 05:16 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@porcow
porcow / hack.sh
Created March 31, 2012 10:16 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@porcow
porcow / PrimeIter.py
Created April 13, 2012 19:39
Prime Number Iterator
def PrimeIter(num):
seq = [ i for i in xrange(num) ]
def gen():
for n in seq:
if 2<=n<=num/2:
yield n
@porcow
porcow / tail_call_optimized.py
Created May 3, 2012 01:58
Tail Call Optimization Decorator (Python recipe)
## {{{ http://code.activestate.com/recipes/474088/ (r1)
#!/usr/bin/env python2.4
# This program shows off a python decorator(
# which implements tail call optimization. It
# does this by throwing an exception if it is
# it's own grandparent, and catching such
# exceptions to recall the stack.
import sys
@porcow
porcow / configure.sh
Created July 21, 2012 14:49
Configure parameters for PHP 5.4 on Lion
./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/private/etc \
--with-apxs2=/usr/sbin/apxs \
--enable-cli \
--with-config-file-path=/etc \
--with-libxml-dir=/usr \
--with-openssl=/usr \
@porcow
porcow / fib.rkt
Created November 4, 2012 20:10
SICP Exercise 1.19 Solution
(define (fib n)
(define (even? n)
(= (remainder n 2) 0))
(define (square n)
(* n n))
(define (double n)
(+ n n))
(define (fib-iter a b p q count)
(cond ((= count 0) b)
((even? count) (fib-iter a
@porcow
porcow / .tmux.conf
Created November 13, 2012 06:31 — forked from zhasm/.tmux.conf
tmux config
#ctrl a
set -g prefix ^a
unbind ^b
bind a send-prefix
#此类配置可以在命令行模式中输入show-options -g查询
#set-option -g base-index 1 #窗口的初始序号;默认为0,这里设置为1
set-option -g display-time 5000 #提示信息的持续时间;设置足够的时间以避免看不清提示,单位为毫秒
set-option -g repeat-time 1000 #控制台激活后的持续时间;设置合适的时间以避免每次操作都要先激活控制台,单位为毫秒
set-option -g status-keys emacs #操作状态栏时的默认键盘布局;可以设置为vi或emacs
set-option -g status-right "#(date +%H:%M' ')" #状态栏右方的内容;这里的设置将得到类似23:59的显示
@porcow
porcow / FOO.sh
Created December 3, 2012 18:19
System V init script
#!/bin/bash
#
# chkconfig: 35 90 12
# description: Foo server
#
# For CentOS and RedHat run the following command as root :
# /sbin/chkconfig FOO on
#
# Get function from functions library
. /etc/init.d/functions

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

Python Number Conversion Chart

From To Expression