Skip to content

Instantly share code, notes, and snippets.

View jaredhirsch's full-sized avatar
:octocat:
pretty excited firefox is moving from hg to github!

Jared Hirsch jaredhirsch

:octocat:
pretty excited firefox is moving from hg to github!
View GitHub Profile
@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:c9be82b168c5c823b407
Last active October 1, 2024 15:18
how to delete your tweets just using your browser, no oauth required
// 1. go to your twitter feed with tweets and replies
// for example, mine was twitter.com/6a68/with_replies
// 2. scroll all the way down to the bottom of the page.
// I suppose you could automate this with JS, but I didn't.
// this function will delete tweets you can delete, i.e. not retweets:
function deleteTweets() {
// find the next delete button in the DOM (next deletable tweet)
// and click the delete button. I wanted to keep the first tweet,
// which is why the index here is 1.
if (!$('.js-actionDelete').length) {
@jaredhirsch
jaredhirsch / gist:1ddb70b8f8f601b20f4e
Last active November 21, 2021 21:13 — forked from mala/gist:77891
adding a glitch button to this version
// ==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')
@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")'
})
})
/* 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: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
@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: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: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:8608817
Created January 24, 2014 23:18
firefox accounts prefs
// 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);
// use the old version of the server until sam has fixed bug 943521
user_pref("identity.fxaccounts.auth.uri", "https://api-accounts-legacy.dev.lcip.org/v1");
// enable debugging of certified/system apps