Skip to content

Instantly share code, notes, and snippets.

@jedp
jedp / go-mode-load.el
Created October 19, 2012 05:17
Emacs go mode
;;; go-mode-load.el --- Major mode for the Go programming language
;;; Original source: http://golang.org/misc/emacs/go-mode-load.el
;;; Commentary:
;; To install go-mode, add the following lines to your .emacs file:
;; (add-to-list 'load-path "PATH CONTAINING go-mode-load.el" t)
;; (require 'go-mode-load)
;; After this, go-mode will be used for files ending in '.go'.
@jedp
jedp / gist:3922102
Created October 20, 2012 05:12
Blog Draft - Tracking Down Memory Leaks in Node.JS

#Tracking Down Memory Leaks in Node.JS

Last month, the Identity team at Mozilla delivered the first beta release of Persona. Getting to this point, we built a lot of tools to help us achieve the scalability and performance that Persona demands, and to help us with problems ranging from debugging to localization to dependency management and more. As a team, we hope our solutions will be useful to other developers, and of course we hope that other developers will help us make our tools even better. So we're kicking off a series of blog posts in which we're going to talk about

@jedp
jedp / gist:4062623
Last active October 12, 2015 17:37
try server and mercurial queues
# push to try
hg qref --message "try: -b do -p all -u all -t none"
hg push -f try
# refresh with name and bug info
hg phase -f --draft qbase:tip # if it complains about immutable revisions
hg qrefresh -m "Bug 876543 - blah blah blah. r=pqdbach"
@jedp
jedp / gist:4239157
Created December 8, 2012 07:43
Making small strings out of big numbers
var chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
function baseFoo(num) {
num = Math.abs(num);
var base = chars.length;
var out = "";
var rem;
if (num === 0) return chars[0];
@jedp
jedp / gist:4262053
Last active October 13, 2015 21:58
Setting Up Marionette Tests

##Overview

For Identity, we have a native implementation of persona for b2g. We have a quantity of native firefox (gecko) code to test, and we have a quantity of front-end (gaia) code to test. Our code is exercised through DOM API calls. To have assurance that all our code works correctly in concert, we require a robust suite of front-end tests. So we want to contribute to automated testing on b2g. This gist describes how someone writing gecko, gaia, apps, or all of the above can do that.

The following movie demonstrates a marionette test suite driving a gaia test_app to

@jedp
jedp / gist:4532412
Created January 14, 2013 19:04
pretty-print a browserid assertion
import base64
import json
from datetime import datetime
def decodeB64(b64input):
"""
Add padding to b64input if necessary. I think python's base64
implementation is broken and this should not be necessary.
"""
out = b64input.strip()
@jedp
jedp / gist:4552786
Last active December 11, 2015 05:29
Jed's (was) another Perl Hacker

Thanks to the Way Back Machine, I found the perl sigs that I wrote while avoiding doing work on my Latin PhD in the years 2000 and 2001 AD.

I have no idea if these still work with anything other than Perl 4 or whatever it was at the time. I also have no idea how to write perl anymore. But I was addicted to playing games with it at the time. You could write beautiful numerical and lexical puzzles and poems with that crazy language. It was so much fun to explore with. And the Perl Journal was awesome.

1

':2F5D)W,@86YO=&AE<B!P97)L(&AA8VME<@H'=~/.*/&& print unpack ("u",$&);
@jedp
jedp / gist:4611182
Created January 23, 2013 18:14
François' throttle script
#!/bin/sh
tc qdisc del dev eth0 root 2> /dev/null
if [ "z$1" = "zdialup" ] ; then
echo "Brace yourself, enabling dialup preset..."
BANDWIDTH=56kbit
LATENCY=200msec
elif [ "z$1" = "z2g" ] ; then
echo "Enabling 2G preset..."
@jedp
jedp / gist:4741148
Created February 8, 2013 18:59
Check processes with OOM score on b2g
watch -n.5 adb shell b2g-ps --oom
#
#!optional
#!rest
#(
#\
#\altmode
#\backnext
#\backspace
#\call
#\linefeed