Skip to content

Instantly share code, notes, and snippets.

@stephenLee
stephenLee / cheatsheet.md
Created September 2, 2012 13:59
git cheatsheet

Workflow

  • Do some programming
  • git add
  • git status to see what files changed
  1. git status -s
  • git diff [file] to see exactly what modified
  1. git diff --cached
@stephenLee
stephenLee / test.py
Created August 22, 2012 12:41
embed gist to my blog
def test_gist():
if worked == True:
print "It's cool!"
else:
print "Damn it!"
if __name__ == '__main__':
test_gist()
@stephenLee
stephenLee / login.py
Created July 11, 2012 14:51
login renren and weibo mobile websites
import requests
renren_payload={'email': '', 'password':''}
weibo_payload={'uname': '', 'pwd': ''}
renren = requests.post('http://3g.renren.com', data=renren_payload)
weibo = requests.post('http://m.weibo.cn', data=weibo_payload)
@stephenLee
stephenLee / design_algorithm.py
Created June 27, 2012 01:22
Udacity CS 215, algorithm design
def algorithm_development(problem_spec):
correct = False
while not correct or not fast_enough(running.time):
algorithm = devise_algorithm(problem_spec)
correct = analyze_correct(algorithm)
running.time = analyze_efficiency(algorithm)
return algorithm