Skip to content

Instantly share code, notes, and snippets.

View anthonywu's full-sized avatar

Anthony Wu anthonywu

  • Silicon Valley / Bay Area
View GitHub Profile
@anthonywu
anthonywu / lib_search_guide.md
Last active January 3, 2016 22:19
programming library search

Before writing any in-house code, it is wise to check if there already exists a published library for the task at hand. If you're interacting with a service, chances are the developers of the service had taken time to develop official libraries for the more popular programming languages. If it's a task that you suspect is a solved problem, chances are someone has taken the initiative to open source their solution.

Here are the resources to discover libraries and tools for your programming task.

Python

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EthernetBuiltIn</key>
<string>Yes</string>
<key>GenerateCStates</key>
<string>Yes</string>
<key>GeneratePStates</key>
<string>Yes</string>
@anthonywu
anthonywu / fb-git-review-install.sh
Created May 8, 2013 17:54
Install Facebook git-review on OS X
# checkout git-review from GitHub and install
# note: this is not the same git-review available via pip installer
git clone git@github.com:facebook/git-review.git
cd git-review/
sudo python setup.py install
# assuming you have Homebrew installed
brew install tkdiff
@anthonywu
anthonywu / install_ubuntu_chrome.sh
Created May 8, 2013 18:02
Install Google Chrome on Ubuntu
# run with sudo user privileges
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo chmod 644 /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update
sudo apt-get install google-chrome-stable
@anthonywu
anthonywu / dot_emacs.el
Created March 29, 2012 05:42
my dot emacs
(add-to-list 'load-path "~/.emacs-lisp")
;; Auto-Complete
(require 'anything)
;; Python nice-to-haves
(require 'lambda-mode)
(add-hook 'python-mode-hook #'lambda-mode 1)
(setq lambda-symbol (string (make-char 'greek-iso8859-7 107)))
@anthonywu
anthonywu / py_tuple_unpack.py
Created February 29, 2012 23:13
Python args tuple unpacking
def foobar(a, b, c, (username, password)=(None,None)):
print a, b, c, username, password
foobar(1, 2, 3, ('hello','world')) # 1 2 3 hello world
foobar(1, 2, 3) # prints "1 2 3 None None"
@anthonywu
anthonywu / human_enum.py
Created February 27, 2012 00:43
Python Human Enums
"""
Copyright (c) 2012 Anthony Wu, twitter.com/anthonywu
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@anthonywu
anthonywu / quick_enums.py
Created February 1, 2012 23:50
Python enum classes
# Author: Anthony Wu
# A quick way to make Python enum classes.
# Uses range/enumerate to quickly generate a list of enumerated values,
# but only safe/useful for your application logic where you don't have
# to persist these values to a data store.
# Example A: hard code enum classes
class Fruits(object):
@anthonywu
anthonywu / keybase.md
Created July 15, 2015 22:12
keybase.md

Keybase proof

I hereby claim:

  • I am anthonywu on github.
  • I am anthonywu (https://keybase.io/anthonywu) on keybase.
  • I have a public key whose fingerprint is B705 0771 3519 68DA AACE 104C AB83 AD17 6691 0D05

To claim this, I am signing this object: