Skip to content

Instantly share code, notes, and snippets.

david kaye dfkaye

Block or report user

Report or block dfkaye

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dfkaye
dfkaye / hugo.md
Last active Nov 10, 2019
Switching to the Hugo static site generator - reasons, resources, more
View hugo.md

Switching to the Hugo static site generator - reasons, resources, more

Background

@dfkaye
dfkaye / data-store-using-http-verb-methods.js
Created Oct 21, 2019
BOREDOM IS THE MOTHER OF REINVENTION
View data-store-using-http-verb-methods.js
// 20 OCT 2019
// PLAYING WITH DATA STORE USING HTTP VERBS AS METHOD NAMES
// NO SCHEMA
// IMMUTABLE via Object.create
// NEED TO CHANGE ERROR CONCEPT
// NEED TO USE STRUCTURE SHARING MERGE (PATCH) - MAYBE
// NEED TO ADD HISTORY
var cache = Data.cache = {};
@dfkaye
dfkaye / elements-up-next.md
Last active Oct 18, 2019
todo list of html elements to create next
View elements-up-next.md
@dfkaye
dfkaye / eric-rey-it-gen-examples.js
Created Oct 18, 2019
Notes from Eric Rey, "Iterators and Generators do have a place in modern JavaScript"
View eric-rey-it-gen-examples.js
// 17 Oct 2019
// Notes from Eric Rey, "Iterators and Generators do have a place in modern JavaScript" (25 Aug 2018)
// https://itnext.io/iterators-and-generators-do-have-a-place-in-modern-javascript-d4cb589b491
// I LIKE THE FIRST USE
// Custom Collections
function EvenNumbers(values = []) {
values = [...values];
@dfkaye
dfkaye / unloading-a-website.js
Created Oct 17, 2019
"Unloading a website" - fragment by @etoxin
View unloading-a-website.js
// 16 October 2019
// modified version from tweet by @etoxin
// https://twitter.com/etoxin/status/1179644600522162176
// "I like to call this unloading a website."
// https://twitter.com/etoxin/status/1179646206529564672
Array.from(document.querySelectorAll('*'))
.reverse()
@dfkaye
dfkaye / SCRIABIN-TECH-INTERVIEWS.md
Last active Sep 26, 2019
every tech interview is a "prove you know Scriabin" experience in one of three flavors
View SCRIABIN-TECH-INTERVIEWS.md

Interviewing with a hi-tech dilettante:

"whiteboard this as I describe it to you inaccurately"

Can be likened to an audition:

"sight-read part three, which you can't if you've not seen part one"

Or just:

@dfkaye
dfkaye / i-threw-out-the-rules-and-so-can-you.txt
Last active Sep 20, 2019
Throw out the rules. Object-oriented vs Functional is a false dichotomy. Tested vs Untested is the ONE TRUE ACID SCOTSMAN.
View i-threw-out-the-rules-and-so-can-you.txt
Last year we threw out all the "rules" for front-end app development and testing.
No app libraries, no framework, no CSS libraries, etc.
We used MUTABLE data and functions. No classes, no data hiding.
We broke the No True Scotsman rules around unit tests. We tested our request modules (they depended on short-lived tokens making them hard to exercise with Postman).
We wrote Mocha tests for everything, using live-server from the command line, downloading Mocha and Chai from unpkg.com right into the HTML test page.
@dfkaye
dfkaye / auto-grid.css
Created Sep 19, 2019
Andy Bell's auto grid CSS without media queries
View auto-grid.css
/*
19 Sept 2019
See "Keeping it simple with CSS that scales"
at https://hankchizljaw.com/wrote/keeping-it-simple-with-css-that-scales/
*/
.auto-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
grid-gap: 1rem;
View generator-channel-example.js
// 17 Sept 2019
// from david nolan's 24 aug 2013 post - http://swannodette.github.io/2013/08/24/es6-generators-and-csp
function go_(it, step) {
console.log({ it, step });
while(!step.done) {
var arr = step.value(),
state = arr[0],
value = arr[1];
View tevko-task-runtime-problem.js
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
// This version, 5 Sept 2019
// First version, 18 Dec 2018
// See original Math Problem gist by @tevko
// https://gist.github.com/tevko/20f8fc446d219f4714517aab19c5dd71
// See postscript at the end of this gist for next thoughts...
// Set up our constraints first.
You can’t perform that action at this time.