Skip to content

Instantly share code, notes, and snippets.

View jaredhirsch's full-sized avatar
🙃
mostly working in mozilla repositories these days

Jared Hirsch jaredhirsch

🙃
mostly working in mozilla repositories these days
View GitHub Profile
@jaredhirsch
jaredhirsch / gist:10426418
Last active August 29, 2015 13:58
dont fuck up merges to gaia

dont fuck up merges to gaia :neckbeard:

  1. do you have r+ from a peer?
  2. are all the tests green in travis?
  3. have you squashed all the commits?
  4. have you updated the commit log to include r=foo?
  5. is the commit log of the form "Bug XXXXXX - TITLE OF BUG r=foo" ?
  6. is the branch good to merge, or does it need to be rebased?

ok, go ahead and merge using the github interface.

@jaredhirsch
jaredhirsch / gist:10479672
Created April 11, 2014 15:54
My gaia custom-prefs file (build/config/custom-prefs.js)
// FxA-related prefs from sam
user_pref("dom.identity.enabled", true);
user_pref("toolkit.identity.debug", true);
user_pref("dom.inter-app-communication-api.enabled", true);
user_pref("dom.identity.syntheticEventsOk", true);
// enable debugging of certified/system apps
user_pref("devtools.debugger.forbid-certified-apps", false);
// some other prefs copied from
@jaredhirsch
jaredhirsch / gist:856dc5a3688addaefe7b
Created May 2, 2014 21:22
madness is 400k lines of code with zero documentation
jareds-partybus:mozilla-b2g-gaia jhirsch$ cloc apps shared --exclude-ext=xml
3259 text files.
3104 unique files.
534 files ignored.
http://cloc.sourceforge.net v 1.60 T=18.33 s (144.6 files/s, 34941.5 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Javascript 2098 72104 71737 421091
@jaredhirsch
jaredhirsch / gist:13c719b694672f221dab
Created May 10, 2014 04:51
persona ephemeral instance creation error
jareds-partybus:mozilla-persona jhirsch$ ./scripts/deploy.js deploy omega -t m1.small
awsbox cmd: node_modules/.bin/awsbox create --ssl=force -n omega -p /Users/jhirsch/.persona_secrets/cert.pem -s /Users/jhirsch/.persona_secrets/key.pem -d -u https://omega.personatest.org -t m1.small -x /Users/jhirsch/.persona_secrets/smtp.json
(using region us-east-1)
reading .awsbox.json
attempting to set up VM "omega"
You said -d, so we shall check dnsHost=omega.personatest.org
... Checking for DNS availability of omega.personatest.org
... instance launched - i-fbe651ab - waiting for startup
... not yet created
... not yet created
/* global SettingsListener */
'use strict';
navigator.mozL10n.once(function fmd_menu_l10n_ready() {
SettingsListener.observe('findmydevice.enabled', false,
function fmd_menu_enabled_status(value) {
var _ = navigator.mozL10n.get;
var desc = document.getElementById('findmydevice-desc');
desc.textContent = value ? _('enabled') : _('disabled');
@jaredhirsch
jaredhirsch / gist:8b1e2f0743d953a3c638
Created June 27, 2014 20:09
gaia hackin 4 the lulz
// do this to make your homescreen background a sweet gif
// someplace inside homescreen app
document.addEventListener('visibilitychange', function yay_gifs() {
if (document.hidden) { return; }
// might not even need the setTimeout, dunno how timing works
// with homescreen blob generation
setTimeout(function() {
document.body.style.cssText = 'background: url("http://media.giphy.com/media/rriYfsQZRE9Pi/giphy.gif")'
})
})
@jaredhirsch
jaredhirsch / gist:00137b5157fd427c691a
Created September 5, 2014 00:17
hacking on gaia / firefox os: how to debug user builds

Sometimes a Gaia bug only shows up in User, not Engineer, builds.

How to get this to a debuggable state?

This works for me for 2.1 aurora builds. It might be wildly inaccurate by the time you read this ^_^

  1. Enable developer menu
  • this recently changed; you have to go into Device information > more information, then scroll to the bottom
  1. Enable ADB and Devtools debugging inside Developer.
  2. Enable debugging of certified apps
@jaredhirsch
jaredhirsch / gist:62f6fbce8f47e5595ddf
Created October 27, 2014 21:58
tracking my own work across time

I want to improve how I document the work I do.

Idea: for each bug, keep a text file collecting my thoughts.

Also: create a pull request from my branch to my own fork, and put comments in there on the diff itself.

Maybe this will help me to recall earlier decisions in more detail.

Let's see :-)

  1. declarative programming sucks horribly
  • because you have to, in your brain, understand every fact in the system and how they interact
  • this is not how human brains work, we think in narratives, in linear flows
  • this is why it's impossible to debug CSS (or Puppet, or XML...)
  1. there is a fix
  • instead of a huge graph of possible interacting facts,
  • just eliminate the cascade as much as humanly possible
  1. there are two ways
  • one is to overspecify every property of every node. this is how less/sass work.
  • two is to use lots of generic classes, like how css frameworks work (oocss, etc).
@jaredhirsch
jaredhirsch / gist:254bea7817193e396b3e
Created November 14, 2014 21:56
i could tweet this, but i'll put it here randomly instead

I have like, so many old local branches. how to get rid of the ones I don't need any more?

courtesy of [1], the answer is: "delete the ones that have been merged":

git branch --merged | grep -v \* | xargs git branch -D

[1] http://stackoverflow.com/a/10610669