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
[buildout] | |
parts = raindrop | |
find-links = . | |
[raindrop] | |
recipe = zc.recipe.egg | |
eggs = | |
Twisted | |
pyOpenSSL | |
paisley |
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
div.HprMsc div.ii, | |
table.cf textarea.Ak { | |
font-family: Monaco,monospace !important; | |
font-size: 10px !important; | |
} |
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
""" | |
Takes CSV locale statistics from addons.mozilla.org and sums numbers | |
for same languages (e.g. es = es + es_ES + es_MX + ...). Output is | |
similarly formatted CSV. | |
""" | |
import sys | |
languages = {} | |
for line in open(sys.argv[-1]): |
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
// Consider a function: | |
function multiply(a, b) { | |
return a*b; | |
} | |
print(multiply(Math.PI, Math.exp(1))) | |
// We want to replace it with an "enhanced" version that does some | |
// stuff before invoking the original, e.g. generate debugging output |
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
/*** Monkey patch vs. evil() ***/ | |
// Consider an object with a method: | |
var Obj = { | |
aMethod: function (arg) { | |
print("Hello " + arg); | |
} | |
}; | |
Obj.aMethod("World!"); |
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
// Install jQuery in each XUL window namespace | |
var wu = require("window-utils"); | |
var module = require("securable-module"); | |
var windowtracker = new wu.WindowTracker({ | |
onTrack: function (window) { | |
var namespace = { | |
window: window, | |
document: window.document, | |
location: window.location, |
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
// https://developer.mozilla.org/en/Setting_up_extension_development_environment | |
user_pref("javascript.options.showInConsole", true); | |
user_pref("nglayout.debug.disable_xul_cache", true); | |
user_pref("browser.dom.window.dump.enabled", true); | |
user_pref("javascript.options.strict", true); | |
user_pref("extensions.logging.enabled", true); | |
user_pref("dom.report_all_js_exceptions", true); |
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
# Start a new chapter by branching the current branch off: | |
(branch chapter5)$ git checkout -b chapter6 | |
# Make some commits: | |
(branch chapter6)$ git commit | |
(branch chapter6)$ git commit | |
# Oh noez, chapter 3 needs a bugfix | |
(branch chapter6)$ git checkout chapter3 | |
(branch chapter3)$ git commit -m "Bugfix" |
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
# wtf8.py | |
import codecs | |
def encode(input, errors='strict'): | |
return input.encode('utf-8', errors).decode('latin-1', errors).encode('utf-8', errors), len(input) | |
def decode(input, errors='strict'): | |
return input.decode('utf-8', errors).encode('latin-1', errors).decode('utf-8', errors), len(input) | |
class StreamWriter(codecs.StreamWriter): |
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
// https://developer.mozilla.org/en/Setting_up_extension_development_environment | |
user_pref("javascript.options.showInConsole", true); | |
user_pref("nglayout.debug.disable_xul_cache", true); | |
user_pref("browser.dom.window.dump.enabled", true); | |
user_pref("javascript.options.strict", true); | |
user_pref("extensions.logging.enabled", true); | |
user_pref("dom.report_all_js_exceptions", true); | |
user_pref("devtools.errorconsole.enabled", true); | |
user_pref("services.sync.log.appender.file.logOnSuccess", true); |
OlderNewer