Skip to content

Instantly share code, notes, and snippets.

View edwindotcom's full-sized avatar
:octocat:
hubba hubba

Edwin Wong edwindotcom

:octocat:
hubba hubba
  • Alameda, CA
View GitHub Profile
git checkout master
git fetch upstream
git merge upstream/master
git push origin master
#!/bin/bash
if [ "$1" == "" ]; then
echo 'appends pref to your profile pref.js'
echo 'Usage: ./addPref.bash [path to prefs.js]'
exit
fi
pref0="user_pref(\"services.sync.log.appender.file.logOnSuccess\", true);"
echo $pref0 >> $1
echo "pref added"
import urllib2
import urllib
import urlparse
import json
import sys
if len(sys.argv) < 2:
sys.stderr.write('Usage: python verifyAcct.py email ')
sys.exit(1)
@edwindotcom
edwindotcom / user.js
Last active August 29, 2015 13:57
server prefs for FxAccounts
/* copy the pref group below into a user.js file created in profile dir. e.g.
* Mac: /Users/<user>/Library/Application\ Support/Firefox/Profiles/<obfuscate_chars>.default/user.js
* Win: C:/Users/Username/Appdata/Roaming/Mozilla/Firefox/Profiles/<obfuscate_chars>.default/user.js
* Lnx: ~/.mozilla/firefox/<obfuscate_chars>.default/user.js
* Restart Firefox
*/
/*
// useful
user_pref("general.warnOnAboutConfig", false);
client.switchToFrame();
console.log("waiting....fxa-email");
client.switchToFrame(selectors.fxaFrame);
client.pageSource(function(err, dump){
console.log('DUMP');
console.log(dump);
});
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'){
@edwindotcom
edwindotcom / gist:0db36eaa5d5cea0a036e
Last active August 29, 2015 14:07
get base image value from kk b2g builds
# for Kitkat base images:
adb shell getprop ro.bootloader
# for pre Kitkat base images:
adb shell getprop t2m.sw.version
user_pref("services.universalSearch.frameURL", "https://localhost:8080/");
user_pref("services.universalSearch.baseURL", "https://localhost:8080/index.html");
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);
@edwindotcom
edwindotcom / diff_lists.py
Last active January 28, 2016 18:31
Takes two files and strips bad chars, spaces and diffs lists
'''
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