Skip to content

Instantly share code, notes, and snippets.

View devonzuegel's full-sized avatar
💖
I've gone to look for myself. If I return before I'm back, please ask me to wait

Devon Zuegel devonzuegel

💖
I've gone to look for myself. If I return before I'm back, please ask me to wait
View GitHub Profile

Bionic Reader Bookmarklet

This bookmarklet is inspired by Bionic Reader API that is truly incredible. However I have issues with service APIs that are not clear on how they handle the privacy and security of my data. So I made a quick and dirty bookmarklet to do the job locally.

  • Create a new bookmark in your browser
  • Use this script as the address:
javascript:(function(){!function(){window.hasOwnProperty("bionicWordWrapApplied")||(!function(e){var n,t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,null);for(;n=t.nextNode();){for(var o,r=n.parentNode,d=n.nodeValue;o=d.match(/^(\s*)(\S+)/);){d=d.slice(o[0].length),r.insertBefore(document.createTextNode(o[1]),n);var a=Math.ceil(o[2].length/2),c=r.insertBefore(document.createElement("b"),n);c.appendChild(document.createTextNode(o[2].slice(0,a)));var i=r.insertBefore(document.createElement("span"),n);i.appendChild(document.createTextNode(o[2].slice(a)))}n.nodeValue=d}}(document.body),window.bionicWordWrapApplied=!0
@IanColdwater
IanColdwater / twittermute.txt
Last active July 2, 2024 02:25
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@backus
backus / signTypedData.js.md
Created April 8, 2018 20:48
How signTypedData works

I couldn't find a good explanation of each step of signTypedData EIP with examples of inputs and outputs at each step. I wanted this so I could keep track.

Say this is our private key

const privKey = new Buffer(
  "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3",
  "hex"
);
@nottombrown
nottombrown / earthquakes_in_sf.md
Last active December 31, 2020 01:02
Earthquake Danger in SF

SF Earthquake Danger

How dangerous are earthquakes to SF residents? My best guess is that we get an extra 15 micromorts per year. That’s a 3% increase over the non-natural causes mortality base rate in the US.

Math

Each year has about a 1/500 chance of a massive 7.9 magnitude earthquake that kills ~6000 people. SF has 800k people. (1/500) * (6000/800000) * 1000000 = 15 micromorts/year

Yearly all non-natural causes mortality in the US is 580 micromorts / year

15 / 580 = 2.6% increase in mortality rate

@KiaraGrouwstra
KiaraGrouwstra / stdlib.ts
Last active March 24, 2020 03:17
Type-level standard library for TypeScript
// NOTE: code now moved to https://github.com/tycho01/typical
// older revision left here, but it no longer runs well in TS Playground
export type Obj<T> = { [k: string]: T };
export type NumObj<T> = { [k: number]: T };
// export type List = ArrayLike; // no unapplied generic types :(
export type List<T> = ArrayLike<T>;
// progress: https://github.com/Microsoft/TypeScript/issues/16392
export function force<T, V extends T>() {}
@ncase
ncase / common-project.md
Last active July 5, 2017 15:33
The Common Project Project (version 0.1)

A country that's polarized is paralyzed. If we want any change in the coming years, we need to find a way to work together. However, you can't just unify people by holding hands and singing Kumbaya. No – rather than ignore or "put aside" our differences, let's use our different perspectives & interests & skills to tackle problems from all possible angles! For us to find common ground, we first need to find common goals.

This is the Common Project project.

Below, you'll find a list of projects, people, organizations, books, talks, movies, articles, and ideas that cross partisan lines to solve The Big Problems we face today. There's many such problems. And we'll need help from all sides.


@martinklepsch
martinklepsch / client.clj
Last active November 26, 2023 20:36
A minimal Clojure client for Airtable.com's HTTP API.
(ns oxygen.client
"A minimal Clojure client for Airtable.com's HTTP API.
Supports retrieval of whole tables as well as individual records.
Dependencies: [org.clojure/data.json \"0.2.6\"] [clj-http \"2.0.0\"]"
(:require [clojure.data.json :as json]
[clojure.string :as string]
[clojure.set :as set]
[clj-http.client :as client]))
(def api-base "https://api.airtable.com/v0")
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active July 12, 2024 11:15
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@paulirish
paulirish / bling.js
Last active July 3, 2024 20:45
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;