Skip to content

Instantly share code, notes, and snippets.

@jhpx
jhpx / genymotionwithplay.txt
Created November 21, 2015 06:28 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161892865 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
@jhpx
jhpx / wget.sh
Created October 30, 2015 04:26
User wget to mirror a whole site
#抓站神命令wget
wget -w 2 -r -np -k -p http://www.stanford.edu/class/cs193p/cgi-bin/drupal/
@jhpx
jhpx / LongestSubString.py
Last active October 30, 2015 04:26
longest substring
#This finds the longest substring that's in all of the words
def longest_substring(data):
substr = ''
if len(data) > 1 and len(data[0]) > 0:
for i in range(len(data[0])):
for j in range(len(data[0])-i+1):
if j > len(substr) and all(data[0][i:i+j] in x for x in data):
substr = data[0][i:i+j]
return substr
@jhpx
jhpx / URLOpen.py
Last active October 30, 2015 04:27
URLOpen
from contextlib import closing
import urllib
with closing(urllib.urlopen('http://www.python.org')) as page:
for line in page:
print line
@jhpx
jhpx / HTTPBasicAuth.py
Last active October 30, 2015 04:27
HTTPBasicAuth
import urllib2
passman = urllib2.HTTPPasswordMgrWithDefaultRealm()
auth_handler = urllib2.HTTPBasicAuthHandler(passman)
auth_handler.add_password(None, url, username, password)
opener = urllib2.build_opener(auth_handler)
page = opener.open(url).read()