Skip to content

Instantly share code, notes, and snippets.

Working from home

Mikeal Rogers mikeal

Working from home
View GitHub Profile
View gist:167554
function (keys, values, rereduce) {
retval = {pass:0, fail:0, todo:0}
var doTest = function (test) {
retval.pass = retval.pass + test.pass; = +;
retval.todo = retval.todo + test.todo;
if (!rereduce) {
for (i in values) {
for (v in values[i]) {
View gist:169436
[Mon, 17 Aug 2009 23:02:14 GMT] [debug] [<0.3968.0>] 'POST' /couchquery_unittest/_bulk_docs {1,1}
Headers: [{'Accept-Encoding',"identity"},
[Mon, 17 Aug 2009 23:02:14 GMT] [error] [<0.3968.0>] Uncaught error in HTTP request: {error,function_clause}
[Mon, 17 Aug 2009 23:02:14 GMT] [debug] [<0.3968.0>] Stacktrace: [{couch_httpd_db,'-db_req/2-fun-0-',[<<"_rev">>]},
View gist:175721
rows = self.db.views.fennecResults.entireBuildsById(keys=[id1, id2])
doc1 = rows[id1]
doc2 = rows[id2]
if len(doc1) == 0 or len(doc2) == 0:
return MakoResponse("error", error="input is not a valid build id")
build1 = Build(doc1[0])
build2 = Build(doc2[0])
answer =
View gist:175722
class TestsResult():
def __init__(self, tests):
self.numtestfiles = len(tests)
self.tests = tests
def smart_sum(x, y):
x['totalfails'] += y['fail']
x['totalpasses'] += y['pass']
x['totaltodos'] += y['todo']
View gist:178611
import json
import simplejson as json
import urllib
import types
tbox_url = ''
logroot = ""
View gist:209694
➜ /Applications
dyld: Library not loaded: Darwin_DBG.OBJ/libjs.dylib
Referenced from: /Applications/
Reason: image not found
[1] 9346 trace trap
View gist:216168
class WhimbooRestart(MozmillRestart):
def __init__(self, *args, **kwargs):
super(MozMillRestart, self).__init__(*args, **kwargs)
self.add_listener(self.whimboo_stuff, eventType="mozmill.persist")
def whimboo_stuff(self, obj):
class WhimbooCLI(RestartCLI):
mozmill_class = WhimbooRestart
View gist:216535
from couchquery import Database
from testbot import create_job
from testbot.client import Client
class TestAgent(Client):
jobtypes = ['xpcshell']
def do_job(self, job):
print job
View gist:220045
import os
from mozmilll import CLI
extension_path = os.path.join(os.path.dirname(__file__), 'jetpack.xpi')
class JetpackCLI(CLI):
def get_profile(self, *args, **kwargs):
profile = super(JetpackCLI, self).get_profile(*args, **kwargs)
return profile
View gist:231386
if files is None: files = []
for full_path in (os.path.join(folder, f) for f in files if os.path.isdir(os.path.join(folder, f))):