View vr_listing.xml
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
<?xml version="1.0"?> | |
<listing xmlns="http://www.airbnb.com/schemas/airbnb-listing/v1" schemaVersion="1.0"> | |
<lastUpdated>2017-08-29T16:36:15Z</lastUpdated> | |
<published>true</published> | |
<basicDetails> | |
<bathrooms>1</bathrooms> | |
<bedrooms>1</bedrooms> | |
<propertyType>house</propertyType> | |
<listingType>entire_home</listingType> | |
<amenities> |
View Smart_Cat_large_image.xml
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
<?xml version="1.0"?> | |
<listing xmlns="http://www.airbnb.com/schemas/airbnb-listing/v1" schemaVersion="1.0"> | |
<lastUpdated>2017-04-15T17:27:40Z</lastUpdated> | |
<published>true</published> | |
<basicDetails> | |
<bathrooms>3</bathrooms> | |
<bedrooms>3</bedrooms> | |
<propertyType>house</propertyType> | |
<listingType>entire_home</listingType> | |
<amenities> |
View tumblr-photo-ripper.rb
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
# Usage: | |
# [sudo] gem install mechanize | |
# ruby tumblr-photo-ripper.rb | |
require 'rubygems' | |
require 'mechanize' | |
# Your Tumblr subdomain, e.g. "jamiew" for "jamiew.tumblr.com" | |
site = "doctorwho" |
View OSPath.py
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
>>> import os | |
>>> print(os.path.join('/Users/pilgrim/diveintopython3/examples/', 'humansize.py')) | |
/Users/pilgrim/diveintopython3/examples/humansize.py | |
>>> print(os.path.join('/Users/pilgrim/diveintopython3/examples', 'humansize.py')) | |
/Users/pilgrim/diveintopython3/examples\humansize.py | |
>>> print(os.path.expanduser('~')) | |
c:\Users\pilgrim | |
>>> print(os.path.join(os.path.expanduser('~'), 'diveintopython3', 'examples', 'humansize.py')) | |
c:\Users\pilgrim\diveintopython3\examples\humansize.py |
View scp
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
# 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/id_dsa.pub user@remotehost:.ssh/authorized_keys |
View ParsePhoneNumber.py
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
import re | |
phonePattern = re.compile(r''' | |
(\d{3}) #area code | |
\D* | |
(\d{3}) #trunk | |
\D* | |
(\d{4}) #number | |
\D* | |
(\d*) #optional extension |
View gcd.py
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
>>> from fractions import gcd | |
>>> gcd(20,8) | |
4 | |
>>> 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 |
View 0_reuse_code.js
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |