Skip to content

Instantly share code, notes, and snippets.

View fengs's full-sized avatar

Sophia Feng fengs

View GitHub Profile
fengs / vr_listing.xml
Last active September 14, 2017 19:43 — forked from zhouxingxing1992/vr_listing.xml
<?xml version="1.0"?>
<listing xmlns="" schemaVersion="1.0">
fengs / Smart_Cat_large_image.xml
Last active January 26, 2018 04:27
smart cat
<?xml version="1.0"?>
<listing xmlns="" schemaVersion="1.0">
fengs / tumblr-photo-ripper.rb
Last active August 29, 2015 14:26 — forked from jamiew/tumblr-photo-ripper.rb
Download all the images from a Tumblr blog
# 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 April 21, 2014 05:34
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 April 21, 2014 01:17
Secure copy to/from remote host using scp and ssh
# 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 April 19, 2014 21:20
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 April 16, 2014 03:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console