Skip to content

Instantly share code, notes, and snippets.

View newswim's full-sized avatar
🦬
Hi

Dan Minshew newswim

🦬
Hi
View GitHub Profile
@busypeoples
busypeoples / reason-remote-data.re
Last active September 7, 2019 14:13
ReasonML port remote-data
/*
remote-data ported to ReasonML
See also https://github.com/krisajenkins/remotedata
Tools for fetching data from remote sources (incl. HTTP).
*/
type remoteData 'e 'a
= NotAsked
| Loading
@tb
tb / formikApollo.js
Created August 1, 2017 14:43 — forked from mwickett/formikApollo.js
Formik + Apollo
import React from 'react'
import { withRouter, Link } from 'react-router-dom'
import { graphql, compose } from 'react-apollo'
import { Formik } from 'formik'
import Yup from 'yup'
import FormWideError from '../elements/form/FormWideError'
import TextInput from '../elements/form/TextInput'
import Button from '../elements/form/Button'
import { H2 } from '../elements/text/Headings'
@paf31
paf31 / FreeAp.md
Last active September 17, 2019 21:08
FreeAp f is a Comonad

FreeAp f is a Comonad

While thinking about comonads as spaces and Day convolution, I realized an interesting thing. The free applicative functor generated by a comonad f is also a comonad.

The free applicative can be defined in a few different ways, but I like to define it like this:

data FreeApplicative f a = Pure a | Free (Day f (FreeApplicative f) a)

Lightning Talk proposal for ReactiveConf 2017 http://www.reactiveconf.com #ReactiveConf

Porting Prezi to Elm in 99 lines of code

Elm is a statically-typed functional programming language. Its compiler produces safe JavaScript which is guaranteed to be free of runtime exceptions. Moreover Elm is packed with a bunch of powerful abstractions which let us build visual and reactive Web applications in a few lines of code.

As an example, I show the implementation of a simple framework for building Prezi-like presentations. It's just 99 lines of code!

@td0
td0 / VSCode-custom.css
Last active August 30, 2018 22:13
vscode-styles for operator mono, fira code ligatures, and oceanic next italic
div.window-title, div.panel-header div.title, a.editor-status-mode,
div.results-group, span.quick-open-entry-description>span.monaco-highlighted-label:first-child,
.input, div.column.when span,
.Equinusocio-vsc-material-theme-themes-Material-Theme-Palenight-json .mtk12,
.Equinusocio-vsc-material-theme-themes-Material-Theme-Palenight-json .mtk9,
.Equinusocio-vsc-material-theme-themes-Material-Theme-Palenight-json .mtk4,
.Equinusocio-vsc-material-theme-themes-Material-Theme-Palenight-json .mtk3.mtki.detected-link,
.Equinusocio-vsc-material-theme-themes-Material-Theme-Palenight-json span.mtk11.mtki,
.Tyriar-theme-sapphire-theme-bright-json .mtk6,
.zhuangtongfa-Material-theme-themes-OneDark-Pro-json .mtk6,
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active June 6, 2024 15:56
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@hediet
hediet / main.md
Last active March 11, 2024 15:05
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
@bvaughn
bvaughn / react-lifecycle-cheatsheet.md
Last active March 2, 2023 13:29
React lifecycle cheatsheet

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount Constructor equivalent for createClass
render Create and return element(s)
componentDidMount DOM manipulations, network requests, etc.
Updating
componentWillReceiveProps Update state based on changed props
@HugoDF
HugoDF / map.js
Last active October 18, 2016 19:00
ES6 map implementation using recursion and destructuring
function map([ head, ...tail ], fn) {
if (head === undefined && !tail.length) return [];
return tail.length ? [ fn(head), ...(map(tail, fn)) ] : [ fn(head) ];
}
@hcgatewood
hcgatewood / jargonScraper.js
Last active December 23, 2019 08:24
Pull a random word and definition from the Jargon File
// NOTE:
// Must have xray installed.
// Use `npm init -y && npm install -S x-ray` in an empty directory.
// Here's the link for npm: https://docs.npmjs.com/getting-started/installing-node
// NOTE:
// Here's the url of the Jargon File: http://www.catb.org/jargon/html/
'use strict';