Skip to content

Instantly share code, notes, and snippets.

View iwasdavid's full-sized avatar

Dave Lowe iwasdavid

View GitHub Profile
@gaearon
gaearon / Wordle.js
Created January 22, 2022 20:49
wordle v3 (tiny wordle clone i built during a stream) https://www.youtube.com/watch?v=Qxn4-bTOx0g
import { useState, useEffect, useRef, useMemo } from 'react'
export default function Wordle() {
let [currentAttempt, setCurrentAttempt] = useState('')
let [bestColors, setBestColors] = useState(() => new Map())
let [history, setHistory] = usePersistedHistory(h => {
waitForAnimation(h)
})
useEffect(() => {
@tomysmile
tomysmile / mac-setup-redis.md
Last active March 18, 2024 22:12
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@vbfox
vbfox / Dapper.fs
Last active April 21, 2022 02:58
Minimal dapper in F#
module DapperFSharp =
open System.Data.SqlClient
open System.Dynamic
open System.Collections.Generic
open Dapper
let dapperQuery<'Result> (query:string) (connection:SqlConnection) =
connection.Query<'Result>(query)
let dapperParametrizedQuery<'Result> (query:string) (param:obj) (connection:SqlConnection) : 'Result seq =
@sturobson
sturobson / gulpfile.js
Last active October 9, 2020 13:01
My gulpfile.js (so far, so simple). Compiles Sass (removes erroneous _partial compilation), autoprefixes the CSS then minifies the CSS into the folder 'dist/CSS'. Uglifys JS into the foloder 'dist/JS'. Minifys SVGs using SVGO, Minifys images with imagemin. Adds gulp-size to calculate project size. Runs development and production tasks
// Deep Breaths //
//////////////////
// Gulp
var gulp = require('gulp');
// Sass/CSS stuff
var sass = require('gulp-sass');
var prefix = require('gulp-autoprefixer');
var minifycss = require('gulp-minify-css');