This file contains hidden or 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 bottle import route, run, get, post, request, redirect, static_file | |
import json | |
import os | |
import sys | |
from os import listdir | |
from os.path import isfile, join | |
# if not os.environ.has_key("IMG_ROOT"): | |
# print 'need IMG_ROOT env set' |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require "webrick" | |
=begin | |
WEBrick is a Ruby library that makes it easy to build an HTTP server with Ruby. | |
It comes with most installations of Ruby by default (it’s part of the standard library), | |
so you can usually create a basic web/HTTP server with only several lines of code. | |
The following code creates a generic WEBrick server on the local machine on port 1234, |
This file contains hidden or 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
#!/usr/bin/python | |
import json | |
from pprint import pprint | |
import sys | |
sys.setrecursionlimit(1500) | |
def loadJson(json_file): | |
with open(json_file) as jdata: | |
data = json.load(jdata) |
This file contains hidden or 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
#!/usr/bin/python | |
# | |
# usage: python extract_sample.py <url> | |
import requests | |
import json | |
import sys | |
import time | |
from pprint import pprint |
This file contains hidden or 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
#!/usr/bin/python2.7 -S | |
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
# pip install jws | |
# pip install python-jose | |
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this |
This file contains hidden or 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
''' | |
Takes two files and strips bad chars, spaces and diffs lists | |
Usage: python diff_lists.py new.txt old.txt | |
Example: | |
:: new.txt :: | |
len: 14 | |
['1044530', '1179274', '1184663', '1191162', '1195569', '1210586', '1221294', '1224056', '1226094', '1236372', '1237824', '1239042', '1241141', '1241851'] | |
:: old.txt :: | |
len: 15 |
This file contains hidden or 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
function sendMsgToSW(){ | |
sendMessage({ | |
command: 'helloWorld', | |
url: 'foo' | |
}).then(function() { | |
// If the promise resolves, just display a success message. | |
writeLog('postMessage promise returned'); | |
}).then(function(val){ | |
writeLog(val); | |
}).catch(console.error); |
This file contains hidden or 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
user_pref("services.universalSearch.frameURL", "https://localhost:8080/"); | |
user_pref("services.universalSearch.baseURL", "https://localhost:8080/index.html"); |
This file contains hidden or 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
# for Kitkat base images: | |
adb shell getprop ro.bootloader | |
# for pre Kitkat base images: | |
adb shell getprop t2m.sw.version |
This file contains hidden or 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
function loadPage(address, route, lang){ | |
page.customHeaders = {'accept-language': lang}; | |
var address = url + route; | |
var docLocator; | |
var fxaHeader; | |
if (page === 'signup'){ | |
docLocator = 'sign-up'; | |
fxaHeader = "fxa-signup-header"; | |
}else if(page === 'signin'){ |