Skip to content

Instantly share code, notes, and snippets.

Sophia Feng fengs

  • San Francisco
Block or report user

Report or block fengs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View vr_listing.xml
<?xml version="1.0"?>
<listing xmlns="" schemaVersion="1.0">
View Smart_Cat_large_image.xml
<?xml version="1.0"?>
<listing xmlns="" schemaVersion="1.0">
fengs / tumblr-photo-ripper.rb
Last active Aug 29, 2015 — forked from jamiew/tumblr-photo-ripper.rb
Download all the images from a Tumblr blog
View tumblr-photo-ripper.rb
# Usage:
# [sudo] gem install mechanize
# ruby tumblr-photo-ripper.rb
require 'rubygems'
require 'mechanize'
# Your Tumblr subdomain, e.g. "jamiew" for ""
site = "doctorwho"
fengs /
Created Apr 21, 2014
Usage of os.path method of the os module. From
>>> import os
>>> print(os.path.join('/Users/pilgrim/diveintopython3/examples/', ''))
>>> print(os.path.join('/Users/pilgrim/diveintopython3/examples', ''))
>>> print(os.path.expanduser('~'))
>>> print(os.path.join(os.path.expanduser('~'), 'diveintopython3', 'examples', ''))
fengs / scp
Created Apr 21, 2014
Secure copy to/from remote host using scp and ssh
View scp
# make sure ssh-client is installed
# login
$ ssh user@remotehost
# generating key pairs
$ ssh-keygen -t dsa
# install the key by either of the commands
$ scp ~/.ssh/ user@remotehost:.ssh/authorized_keys
fengs /
Created Apr 19, 2014
Parse American phone numbers, with optional extension
import re
phonePattern = re.compile(r'''
(\d{3}) #area code
(\d{3}) #trunk
(\d{4}) #number
(\d*) #optional extension
>>> from fractions import gcd
>>> gcd(20,8)
>>> print inspect.getsource(gcd)
def gcd(a, b):
"""Calculate the Greatest Common Divisor of a and b.
Unless b==0, the result will have the same sign as b (so that when
fengs / 0_reuse_code.js
Created Apr 16, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.