Skip to content

Instantly share code, notes, and snippets.

View Osmose's full-sized avatar

Osmose Osmose

View GitHub Profile
javascript:(function(){
var checks = document.querySelectorAll('input[name^="senderfilterp"]');
for (var k = 0; k < checks.length; k++) {
checks[k].checked = true;
}
document.querySelector('input[name="discardalldefersp"]').checked = true;
})();

Mailman Spam Bookmarklet

The bookmarklet below works on Mozilla's version of Mailman on the spam listing for mailing list maintainers. It checks the "discard all messages marked as deferred" box as well as checking the "add sender to the following list" checkbox, which blacklists them since it defaults to adding them to the discards list.

Bookmarklet

/**
* Parse the given string as HTML and return DOM nodes. Assumes a root
* DOM node because, well, that's all I use it for.
*/
export function dom(html) {
let div = document.createElement('div');
div.innerHTML = html;
return div.firstElementChild;
}

CSS bounce effect on hover for long filenames in a music player.

Preview

<h2 className="name">
    <span className="info-line-wrapper">
        <span className="info-line">
            Some long audio filename
        </span>
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 6.
id,entity_id,locale_id,"string","date",user_id,approved,plural_form,fuzzy,approved_user_id,"approved_date"
46,52,111,"Il nostro team dedicato al supporto è sempre disponibile per aiutarti con qualunque domanda su Firefox.&nbsp;<a>Ulteriori informazioni</a>.","2014-01-15 04:50:04",NULL,0,NULL,0,NULL,NULL
47,53,111,"Se hai bisogno di aiuto, <a>visita Mozilla Support</a>. Se invece sei un utente esperto di Firefox, <a>diventa un volontario</a> e aiutaci a rispondere o scrivere articoli.","2014-04-11 12:46:53",NULL,0,NULL,0,NULL,NULL
48,50,111,"La nuova schermata principale di Firefox per Android ti permette di navigare sul Web più velocemente. <a>Installa oggi stesso Firefox per Android.</a><br>","2014-01-15 04:50:04",NULL,0,NULL,0,NULL,NULL
49,51,111,"Personalizza Firefox con la bandiera della tua nazione e celebra lo spirito globale della comunità.","2014-04-11 12:46:53",NULL,0,NULL,0,NULL,NULL
55,50,85,"Mit dem neuen Firefox-Startbildschirm auf Android können Sie sich schnell durch das Internet bewegen. &lt;a

Keybase proof

I hereby claim:

  • I am osmose on github.
  • I am osmose (https://keybase.io/osmose) on keybase.
  • I have a public key whose fingerprint is 41E2 93A3 4AC9 F05C ABF8 D5C2 780C E613 F8E1 024D

To claim this, I am signing this object:

@Osmose
Osmose / gist:2664ed7e919e91a29909
Last active August 29, 2015 14:00
HTML5 Piano + Recording Mod
// http://bits.potch.me/piano.html
// Copy and paste into console, start playing via keyboard.
// Then, press Z to play back your music!
// Playback deletes recorded music.
var log = [];
var sinceLast = null;
document.body.addEventListener('keydown', function(e) {
if (e.keyCode == 90) {
playBack();
} else {
@Osmose
Osmose / gist:6717196
Last active December 24, 2015 00:29
Git alias for downloading pull requests.
[alias]
pr = "!f() { git fetch origin refs/pull/$1/head:pr/$1; } ; f"
@Osmose
Osmose / gist:6381509
Created August 29, 2013 18:16
git pr 555 # Pull PR #555 down from github as a branch named pr/555
[alias]
pr = "!f() { git fetch origin refs/pull/$1/head:pr/$1; } ; f"