This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
#!/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 | |
# |
def PrimeIter(num): | |
seq = [ i for i in xrange(num) ] | |
def gen(): | |
for n in seq: | |
if 2<=n<=num/2: | |
yield n |
## {{{ 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 |
./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 \ |
(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 |
#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的显示 |
#!/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 |
Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU
Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys
Consumer key: CjulERsDeqhhjSme66ECg