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:48bf56e5b66e8631b522
Last active August 29, 2015 14:17
API between autocomplete code and iframe

Deprecation notice

This API corresponds to the state of the abandoned gecko fork. The project has been ported to an addon which contains the up-to-date API docs in its repo.


browser - iframe API

note (5 February 2016): these docs are old and out of date. UnifiedComplete.js has changed how autocomplete works in Firefox. don't rely on this information when exploring the code.

hacking on gecko

basic dev workflow

getting the code

@jaredhirsch
jaredhirsch / gist:6cbc7e88c57287dac417
Last active August 29, 2015 14:11
looking at hapi repo organization within cloud services
existing repos
==============
fxa-profile-server
/bin
- looks like this just does instantiation, dependency injection,
like the /server directory in the fxa-auth-server repo
- _static.js - load local-dev-only static server
- server.js - just load lib/server and start it, pass in the logger
- worker.js - just load lib/server/worker and call create
@jaredhirsch
jaredhirsch / gist:c065bd2b487a3535504e
Last active August 29, 2015 14:10
exporting firefox history

goal: export my history into a JSON blob that can be imported into a web service.

exporting bookmarks in FF is very easy, but history is a bit harder.

  1. find your profile

this sumo page suggests that you go to about:support and click on the 'show in finder' button to find your profile

  1. extract history from the places.sqlite sqlite3 database
@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

  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:c3ede1aa90f0b3a1a1a9
Last active September 5, 2017 20:04
tmux step by step

update

tmux just didn't do it for me. I'm good enough with vim splits and multiple terminal windows. Sharing a tmux session to do remote pairing is a great feature, but I work solo these days. Giving up for now. Feel free to use this doc if it helps you, though.


meta:

  • Based on my experience learning and teaching vim, I think the most effective way to learn similar tools (like tmux, with oh so many options/commands) is to start with a core set of commands and their inverses, then add fancy bits later.
  • Starting with the core vocabulary, working our way up to the advanced stuff later.
@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 :-)

@jaredhirsch
jaredhirsch / gist:5638a2f70a145374fbf1
Last active September 26, 2015 19:43
Closing IRC when your computer goes to sleep

TL;DR:

My problem: I need to close a program before my mac goes to sleep, but sometimes I forget.

My solution: use SleepWatcher to run an AppleScript that tells the app to quit. It's pretty technical.


I use IRC for work. Some people leave it open all the time; I prefer to use it as "office hours", and only have it open when I'm working and more-or-less interruptible.

@jaredhirsch
jaredhirsch / gist:4dcd73653dd5f9a4dacc
Last active April 6, 2016 13:06
oauth 2, some notes

I did a bit of initial OAuth research this week for FxA (Firefox Accounts). It was interrupted by more pressing stuff (bugs bugs bugs), but thought I'd post my incomplete work-in-progress notes for whenever I get back to this.

Notes come from Getting Started with OAuth 2.0, which I accessed via Safari.

my next steps:

  • look carefully at a number of JS SDKs
  • think in terms of a generic OAuth abstraction for FxOS
  • but begin by building the simplest possible solution for FxA on FxOS
    • we really need implicit grant,
  • and a proxy server that could handle redirects on behalf of serverless apps,