This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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, | |
tt = document.body.innerHTML; | |
var mm, nn, xx; | |
while (mm = p.exec(tt)) nn = mm; | |
while (mm = pp.exec(tt)) xx = mm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//bookmarklet_title: Outline | |
javascript:(function(){window.location = 'https://outline.com/' + window.location})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bookmarklet-title: Unhide | |
// bookmarklet-about: Toggle hidden elements. Credit to u/jcunews1 via https://www.reddit.com/r/bookmarklets/comments/nowz0j/toggle_hidden_elements | |
if (window.unhiddens_bmkl) { | |
unhiddens_bmkl.forEach(o => o[0].style.cssText = o[1]); | |
unhiddens_bmkl = undefined; | |
} else { | |
window.unhiddens_bmkl = []; | |
document.body.querySelectorAll('*:not(script,style)').forEach(e => { | |
if (getComputedStyle(e).display === 'none') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hasher | |
import ( | |
"crypto/sha1" | |
"encoding/hex" | |
"hash" | |
"io" | |
) | |
// HasherReader calculates the hash of a byte stream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Launch Program", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bookmarklet-title: Eno | |
// bookmarklet-about: Plays demoscene interpretation of Brian Eno's 1/2 from the album Ambient 1. Original code by Mathieu Henri (http://www.p01.org/music_for_tiny_airports). | |
const k = 8192; | |
let t = 0; | |
const AudioContext = window.AudioContext || window.webkitAudioContext; | |
const ac = new AudioContext(); | |
const sp = ac.createScriptProcessor(k, 0, 1); | |
sp.connect(ac.destination); | |
sp.onaudioprocess = pe => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (src) => new Promise((resolve, reject) => { | |
const script = document.createElement('script'); | |
script.src = src; | |
script.onload = resolve; | |
script.onerror = reject; | |
document.head.appendChild(script); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//bookmarklet_title: Word Frequency | |
//bookmarklet_about: Display the top five most common words on a webpage. Drag the bookmarklet to your bookmarks bar to use it anywhere! If the word hippo shows up a lot, hippo should have a high occurrence (hippo hippo HIPPO). | |
var counts = { }; | |
var text = document.body.innerText || document.body.textContent || ''; | |
var words = text.split(/\b/).filter((word) => { | |
return word.match(/^\w+$/) !== null; | |
}); | |
words.forEach((word) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prompt | |
PROMPT='%{%F{red}%}♥%{%F{default}%} %1~ %# ' | |
# Aliases | |
alias gitlg="git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all" | |
# Misc. | |
export GREP_OPTIONS='--color=auto' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Modal { | |
constructor(message, timeout=3000) { | |
this.fadeTime = 500; | |
this.modalBackground = '#f00'; | |
this.present(message); | |
this.removeTimer = setTimeout(this.remove.bind(this), timeout); | |
this.fadeTimer = setTimeout(this.fade.bind(this), timeout - this.fadeTime); | |
} | |
present(message) { |
NewerOlder