Skip to content

Instantly share code, notes, and snippets.

View hinzed1127's full-sized avatar

Dan Hinze hinzed1127

View GitHub Profile
@hinzed1127
hinzed1127 / bret_victor-reading_list.md
Created September 9, 2024 20:44 — forked from nickloewen/bret_victor-reading_list.md
Bret Victor’s Reading List

This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.


Highly recommended things!

This is my five-star list. These are my favorite things in all the world.

A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★

@hinzed1127
hinzed1127 / bret_victor-reading_list.md
Created September 9, 2024 20:44 — forked from nickloewen/bret_victor-reading_list.md
Bret Victor’s Reading List

This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.


Highly recommended things!

This is my five-star list. These are my favorite things in all the world.

A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★

Keybase proof

I hereby claim:

  • I am hinzed1127 on github.
  • I am danhinze (https://keybase.io/danhinze) on keybase.
  • I have a public key ASCCq8jdFwsVMcGN8FR95l5EU_-PmxUBt0cXWWSkA1mcowo

To claim this, I am signing this object:

@hinzed1127
hinzed1127 / .eslintrc
Created June 10, 2019 16:20
Basic Setup for prettier and eslint
{
"extends": [
"react-app",
"plugin:jsx-a11y/strict",
"plugin:prettier/recommended"
],
"settings": {
"react": {
"version": "latest"
}
@hinzed1127
hinzed1127 / isInsideElement.js
Created March 4, 2019 17:44
Useful helper function for checking for children elements
// Check if a target is included as a child at any level of a nodeList (direct descendent, grandchild, and so on)
// e.g. a queryString of '.tiles *' will give all descendents of .tiles at every level of descension
export function isInsideElement (target, queryString) {
const children = document.querySelectorAll(queryString);
if (children) {
return Array.from(children).includes(target);
}
return false;
}
@hinzed1127
hinzed1127 / formatMoney.js
Created January 7, 2019 17:48
simple money formatter
// The original function was overly complicated. It needs to do a handful of things:
// - add appopriate number of decimal places
// - validate the number
// - add appropriate number of commas
// - thousands and decimal. Initially tried to use toLocalString() but it didn't work
function addCommasToNumber(num) {
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}