Skip to content

Instantly share code, notes, and snippets.

@ashtonmeuser
Last active August 22, 2024 16:24
Show Gist options
  • Select an option

  • Save ashtonmeuser/6e3869d8e468e016f22a4b4de79509bd to your computer and use it in GitHub Desktop.

Select an option

Save ashtonmeuser/6e3869d8e468e016f22a4b4de79509bd to your computer and use it in GitHub Desktop.

Revisions

  1. ashtonmeuser revised this gist Oct 27, 2023. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions slack.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    //bookmarklet-title: Unfuck Slack
    //bookmarklet-about: Restore Slack's old UI.

    localStorage.setItem("localConfig_v2", localStorage.getItem("localConfig_v2").replace(/\"is_unified_user_client_enabled\":true/g, '\"is_unified_user_client_enabled\":false'));
    location.reload();
  2. ashtonmeuser revised this gist Oct 25, 2023. 3 changed files with 32 additions and 0 deletions.
    23 changes: 23 additions & 0 deletions md-link.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    //bookmarklet-title: Markdown Link
    //bookmarklet-about: Get Markdown link of the current page as [Title](url).

    function e() {
    var e = "";
    if (window.getSelection) e = window.getSelection().toString();
    else if (document.getSelection) e = document.getSelection().toString();
    else {
    if (!document.selection) return null;
    e = document.selection.createRange().text
    }
    return e
    }
    var t = e(),
    n = window.document.title,
    o = window.location.href,
    i = [];
    if (t) {
    i.push("[" + t + "]")
    } else {
    i.push("[" + n + "]"), i.push("(" + o + ")")
    }
    window.prompt("created link", i.join(""))
    5 changes: 5 additions & 0 deletions nitter.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    //bookmarklet-title: Nitter
    //bookmarklet-about: Twitter to Nitter.

    h = ['nitter.it', 'nitter.snopyta.org', 'nitter.net'];
    location.href = location.href.replace(window.location.host, h[Math.floor(Math.random() * h.length)]);
    4 changes: 4 additions & 0 deletions wayback.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    //bookmarklet-title: Wayback
    //bookmarklet-about: See current page on the Wayback Machine.

    window.open('https://web.archive.org/web/*/' + location.href.replace(/\/$/, ''))
  3. ashtonmeuser revised this gist Oct 25, 2023. 3 changed files with 9 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions canvas-dl.js
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    //bookmarklet-title: Canvas DL
    //bookmarklet-about: When playing skribbl.io and someone has made a nice drawing, this lets you download the current drawing as a PNG.

    var w = window.wdq || (window.wdq = document.createElement("a"));
    var p = /The word was '([^']*)'/g,
    pp = /<span>([^<>]+) is drawing now!/g,
    3 changes: 3 additions & 0 deletions no-alt.js
    Original file line number Diff line number Diff line change
    @@ -1 +1,4 @@
    //bookmarklet-title: Nebula No-Alt-#
    //bookmarklet-about: Nebula's video viewer annoying captures e.g. alt-3 to do the same as plain 3 (seek to 3/10 of the video currently playing), but I expect it to switch to the 3rd browser tab instead. YouTube doesn't do this. Luckily I can just activate this bookmarklet.

    document.addEventListener("keydown", (e) => void(e.altKey && !isNaN(+e.key) && e.stopPropagation()))
    3 changes: 3 additions & 0 deletions no-paste.js
    Original file line number Diff line number Diff line change
    @@ -1 +1,4 @@
    //bookmarklet-title: Don't Mess With Paste
    //bookmarklet-about: For when signup forms expect you to hand-type your email address twice.

    ["contextmenu", "copy", "paste", "selectstart"].map(e => document.addEventListener(e, e => e.stopPropagation(), true))
  4. ashtonmeuser created this gist Oct 25, 2023.
    10 changes: 10 additions & 0 deletions canvas-dl.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    var w = window.wdq || (window.wdq = document.createElement("a"));
    var p = /The word was '([^']*)'/g,
    pp = /<span>([^<>]+) is drawing now!/g,
    tt = document.body.innerHTML;
    var mm, nn, xx;
    while (mm = p.exec(tt)) nn = mm;
    while (mm = pp.exec(tt)) xx = mm;
    w.download = location.host + "_" + (nn ? nn[1] + "_" : "") + (xx ? xx[1] + "_" : "") + new Date().toISOString().replace(/:/g, "_");
    w.href = document.querySelector("canvas").toDataURL();
    w.click();
    1 change: 1 addition & 0 deletions no-alt.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    document.addEventListener("keydown", (e) => void(e.altKey && !isNaN(+e.key) && e.stopPropagation()))
    1 change: 1 addition & 0 deletions no-paste.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ["contextmenu", "copy", "paste", "selectstart"].map(e => document.addEventListener(e, e => e.stopPropagation(), true))