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 / asound.state
Created March 10, 2023 13:03
Scarlett 18i6 alsa asound.state file, generated on ubuntu 22
state.PCH {
control.1 {
iface MIXER
name 'Headphone Playback Volume'
value.0 0
value.1 0
comment {
access 'read write'
type INTEGER
count 2
@jaredhirsch
jaredhirsch / gecko-cpp.md
Last active January 25, 2022 15:51
My notes from the C++ and Gecko onboarding video
@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:4963424
Last active March 19, 2021 08:54
ETags & If-None-Match headers: a dialogue

ETags & If-None-Match headers: a dialogue

1st request.

browser: can haz foo?

GET /foo HTTP/1.1

1st response.

@jaredhirsch
jaredhirsch / howto-detumblrize.mkd
Last active January 22, 2021 20:55
Downloading stuff off of tumblr

TL;DR skip to the summary for the bash one-liner if so inclined :-)

Why & wherefore

I have an old tumblr that I want to back up. I don't use it regularly, but I want to have a backup of the whole site, design as well as content, just in case; it's not just the pictures I love, but the whole thing. I'm not particularly worried about downloading the streaming audio--can't help you there, gentle reader.

@jaredhirsch
jaredhirsch / gist:4971859
Created February 17, 2013 15:19
all about ETags

ETags: a pretty sweet feature of HTTP 1.1

HTTP caching review

HTTP provides two ways for servers to control client-side caching of page components:

  • freshness may be based on a date or a token whose meaning is app-specific
  • whether or not the client needs to confirm the cached version is up-to-date with the server

This breaks down as follows:

  • Cache locally and don't check before using.
@jaredhirsch
jaredhirsch / gist:c9be82b168c5c823b407
Last active February 11, 2020 16:13
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 / foo.md
Last active November 6, 2019 23:53
attaching debuggers to things

(Note: I moved this info into the main FxA readme at https://github.com/mozilla/fxa.)

Attaching a debugger to a running node process, sadly, requires running google chrome (AFAIK).

How to do it:

  1. Start google chrome and open up chrome://inspect.

  2. Run a node process using the --inspect or --inspect-brk flags (see specific command-line incantations below)

@jaredhirsch
jaredhirsch / ugh
Created July 9, 2019 22:57
fxa monorepo npm install = node-gyp dumpster fires
[15:51:37 mozilla-fxa (mozilla-master) ]$ npm install
> fxa@2.0.0 postinstall /Users/jh/codez/github/mozilla-fxa
> _scripts/postinstall.sh
+ '[' '' = true ']'
+ _scripts/install_all.sh
+ _scripts/check.sh
++ which rustup
+ [[ ! -n /Users/jh/.cargo/bin/rustup ]]
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/libbacktrace" "-I" "/Users/jh/codez/github/mozilla-fxa/packages/fxa-email-service/target/debug/build/backtrace-sys-a925084960b3e8d2/out" "-fvisibility=hidden" "-DBACKTRACE_SUPPORTED=1" "-DBACKTRACE_USES_MALLOC=1" "-DBACKTRACE_SUPPORTS_THREADS=0" "-DBACKTRACE_SUPPORTS_DATA=0" "-DHAVE_DL_ITERATE_PHDR=1" "-D_GNU_SOURCE=1" "-D_LARGE_FILES=1" "-Dbacktrace_full=__rbt_backtrace_full" "-Dbacktrace_dwarf_add=__rbt_backtrace_dwarf_add" "-Dbacktrace_initialize=__rbt_backtrace_initialize" "-Dbacktrace_pcinfo=__rbt_backtrace_pcinfo" "-Dbacktrace_syminfo=__rbt_backtrace_syminfo" "-Dbacktrace_get_view=__rbt_backtrace_get_view" "-Dbacktrace_release_view=__rbt_backtrace_release_view" "-Dbacktrace_alloc=__rbt_backtrace_alloc" "-Dbacktrace_free=__rbt_backtrace_free" "-Dbacktrace_vector_finish=__rbt_backtrace_vector_finish" "-Dbacktrace_vector_grow=__rbt_backtrace_vector_grow" "-Dbacktrace_vector_release=__rbt_backtrace_vector_release" "-Dbacktr