-
Install redis on OSX (10.7) Lion I used:
$ brew install redis
-
In the project and virtualenv I wanted to use django-celery in I installed the following.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# "Understanding Python's closures". | |
# | |
# Tested in Python 3.1.2 | |
# | |
# General points: | |
# | |
# 1. Closured lexical environments are stored | |
# in the property __closure__ of a function | |
# | |
# 2. If a function does not use free variables |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Xcode 4.3.3 | |
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn) | |
Target: x86_64-apple-darwin11.4.0 | |
Thread model: posix | |
# Xcode 4.3.2 | |
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn) | |
Target: x86_64-apple-darwin11.4.0 | |
Thread model: posix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph { | |
思维导图 -> { OmniGraffle XMind dot }; | |
OmniGraffle -> { 排版糟糕 单调 贵 }; | |
XMind -> { 排版不错 主题好看 中文输入很麻烦 }; | |
dot -> { 很强大 灵活 不适合现场演示 }; | |
} |
Git 比较不同版本文件差异的常用命令格式:
git diff 查看尚未暂存的文件更新了哪些部分
git diff filename 查看尚未暂存的某个文件更新了哪些
git diff –cached 查看已经暂存起来的文件和上次提交的版本之间的差异
git diff –cached filename 查看已经暂存起来的某个文件和上次提交的版本之间的差异
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts #-} | |
module Jobsteps ( | |
createDiskClone | |
, exposeISCSI | |
, createMachine | |
, startMachine | |
, runJob | |
) where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 2 ]; then | |
echo "Usage: $0 file partSizeInMb"; | |
exit 0; | |
fi | |
file=$1 | |
if [ ! -f "$file" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var https = require('https'), | |
user = process.argv[2], | |
opts = parseOpts(process.argv.slice(3)) | |
request('/users/' + user, function (res) { | |
if (!res.public_repos) { | |
console.log(res.message) | |
return | |
} | |
var pages = Math.ceil(res.public_repos / 100), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# pyenv install for CentOS 6.5 x86_64 | |
yum install -y gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel | |
git clone git://github.com/yyuu/pyenv.git ~/.pyenv | |
export PATH="$HOME/.pyenv/bin:$PATH" | |
eval "$(pyenv init -)" |
OlderNewer