Skip to content

Instantly share code, notes, and snippets.

Avatar
🏖️
chillin

Jared Hirsch 6a68

🏖️
chillin
View GitHub Profile
@6a68
6a68 / gist:10426418
Last active Aug 29, 2015
dont fuck up merges to gaia
View gist:10426418

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.

@6a68
6a68 / gist:10479672
Created Apr 11, 2014
My gaia custom-prefs file (build/config/custom-prefs.js)
View gist:10479672
// 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
@6a68
6a68 / gist:856dc5a3688addaefe7b
Created May 2, 2014
madness is 400k lines of code with zero documentation
View gist:856dc5a3688addaefe7b
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
@6a68
6a68 / gist:13c719b694672f221dab
Created May 10, 2014
persona ephemeral instance creation error
View gist:13c719b694672f221dab
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
View gist:05ee234f85a71808a881
/* 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');
@6a68
6a68 / gist:8b1e2f0743d953a3c638
Created Jun 27, 2014
gaia hackin 4 the lulz
View gist:8b1e2f0743d953a3c638
// 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")'
})
})
@6a68
6a68 / gist:1ddb70b8f8f601b20f4e
Last active Aug 29, 2015 — forked from mala/gist:77891
adding a glitch button to this version
View gist:1ddb70b8f8f601b20f4e
// ==UserScript==
// @name GlitchMonkey
// @namespace http://d.hatena.ne.jp/youpy/
// @include *
// @grant GM_xmlhttpRequest
// ==/UserScript==
window.on('load', function() {
// put a button in the corner so we can refry the beans
var container = document.createElement('div')
@6a68
6a68 / gist:00137b5157fd427c691a
Created Sep 5, 2014
hacking on gaia / firefox os: how to debug user builds
View gist:00137b5157fd427c691a

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
@6a68
6a68 / gist:62f6fbce8f47e5595ddf
Created Oct 27, 2014
tracking my own work across time
View gist:62f6fbce8f47e5595ddf

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 :-)

View gist:59185f63f146c66c3d96
  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).
You can’t perform that action at this time.