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
if [ -f ~/bin/sensible.bash ]; then | |
source ~/bin/sensible.bash | |
fi | |
if [ -f ~/bin/git-completion.bash ]; then | |
source ~/bin/git-completion.bash | |
fi | |
export EDITOR="open -t -n -W" |
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
$(`<style> | |
.fp-album-wrapper:not(:hover) .fp-track-listing { | |
display: none; | |
margin-left: -0.5em; | |
} | |
.album-title .fp-track-listing { | |
position: absolute; | |
z-index: 1; | |
} | |
.fp-track-listing { |
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
// Change New Releases page to a complete text listing with hover images | |
if (window.location.pathname === '/homes/new_releases') { | |
$('<style>\ | |
.videos-shadow-container { display: none; }\ | |
.my-top-100-page { height: auto; }\ | |
.album-shadow-container > .album-scrollable { display: none; }\ | |
.album-shadow-container > button { display: none; }\ | |
.album-shadow-container + h3 { display: none; }\ | |
.hnr-at { border-spacing: 3px; border-collapse: separate; margin-left: -3px; font-family: "Helvetica Neue", sans-serif; }\ | |
.hnr-at .album-link img {position: absolute; }\ |
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
$(() => { | |
const observer = new MutationObserver(addFormatControls) | |
observer.observe(document.querySelector('body'), {attributes: true, subtree: true}) | |
function getCommentInput (optionsElement) { | |
return $(optionsElement).closest('.comment-box').find('textarea').get(0) | |
} | |
function wrapSelection (input, wrap) { | |
const selection = input.value.slice(input.selectionStart, input.selectionEnd) |
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
var digitToNum = digit => ({v:digit, f:`${digit}`}) | |
var partitions = x => times(i => [take(i+1, x), drop(i+1, x)], x.length - 1) | |
const negop = {o:(a) => ({o:negop, a, v:-a.v, f:`-${a.f}`})} | |
const unops = [negop] | |
const addop = {o:curry((a,b) => ({o:addop, a, b, v:a.v+b.v, f:`${a.f}+${b.f}`}))} | |
const subop = {o:curry((a,b) => ({o:subop, a, b, v:a.v-b.v, f:`${a.f}-${b.f}`}))} | |
const mulop = {o:curry((a,b) => ({o:mulop, a, b, v:a.v*b.v, f:`${a.f}x${b.f}`}))} | |
const divop = {o:curry((a,b) => (b.v != 0 ? {o:divop, a, b, v:a.v/b.v, f:`${a.f}/${b.f}`} : null))} | |
const biops = [addop, subop, mulop, divop] |
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
// ==UserScript== | |
// @name Google link cleaner | |
// @description Make Google SERPs links go straight to their target, not via Google | |
// @include https://www.google.com/* | |
// @namespace http://thunderguy.com/ | |
// @author Bennett McElwee, bennett@thunderguy.com | |
// ==/UserScript== | |
/* | |
When you click a link in a Google SERPs page, JavaScript redirects you to Google (to |
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
// Similar to JSON.stringify but limited to a specified depth (default 1) | |
// The approach is to prune the object first, then just call JSON.stringify to do the formatting | |
const prune = (obj, depth = 1) => { | |
if (Array.isArray(obj) && obj.length > 0) { | |
return (depth === 0) ? ['???'] : obj.map(e => prune(e, depth - 1)) | |
} else if (obj && typeof obj === 'object' && Object.keys(obj).length > 0) { | |
return (depth === 0) ? {'???':''} : Object.keys(obj).reduce((acc, key) => ({ ...acc, [key]: prune(obj[key], depth - 1)}), {}) | |
} else { | |
return obj |
OlderNewer