Skip to content

Instantly share code, notes, and snippets.

View jhigdon's full-sized avatar
🦝
trash panda coding

Jonathan Higdon jhigdon

🦝
trash panda coding
View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active July 16, 2024 05:35
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@ttesmer
ttesmer / AD.hs
Last active June 7, 2024 03:56
Automatic Differentiation in 38 lines of Haskell using Operator Overloading and Dual Numbers. Inspired by conal.net/papers/beautiful-differentiation
{-# LANGUAGE TypeSynonymInstances #-}
data Dual d = D Float d deriving Show
type Float' = Float
diff :: (Dual Float' -> Dual Float') -> Float -> Float'
diff f x = y'
where D y y' = f (D x 1)
class VectorSpace v where
zero :: v
@davidfowl
davidfowl / MinimalAPIs.md
Last active June 28, 2024 17:42
Minimal APIs at a glance
@chenyong
chenyong / check.cljs
Created June 3, 2019 03:28
Comparing Clojure spec and TypeScript with multiple structs
(def data {
:mock-all? false
:mocks [
{:path "api/test/json", :type :json :status 200 :data {"code" 200, "message" "This is a test json message in EDN"}}
{:path "api/test/file", :type :file :status 200 :file "user-info.json"}
{:path "api/test/text", :type :text :status 200 :text "user-info.json"}
]
:sites {
"api" {:target :apis}
"web" {:target :proxy, :path "/web", :host "http://localhost:8200"}
@CodyReichert
CodyReichert / react-es6-flow-emacs-configuration.md
Last active May 13, 2024 07:35
Configuring Emacs for react, es6, and flow

Configuring Emacs for react, es6, and flow

For a while, JSX and new es6 syntax had flaky support in emacs, but there's been huge work on a lot of packages. Using emacs for JavaScript with React, ES6, and Flow (or Typescript, etc) is really easy and powerful in Emacs these days.

This is how you can work on modern web development projects with full support for tooling like JSX, Flow types, live eslint errors, automatic prettier.js formatting, and more.

Set up web-mode

web-mode provides most of the underlying functionality, so a huge shout-out to the maintainer(s) there.