Skip to content

Instantly share code, notes, and snippets.

const muhReducer = (state, action) => {
switch(action.type) {
case 'FROBNICATE':
return {
frobnicateCount: state.frobnicateCount + 1,
...state,
}
default:
return state
}
const xs = []
const scope = {}
for(scope.i = 0; scope.i < 3; ++scope.i) {
xs.push(() => console.log('scope.i is', scope.i))
}
xs.forEach(f => f())
const xs = []
for(var i = 0; i < 3; ++i) {
xs.push(() => console.log('i is', i))
}
xs.forEach(f => f())
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/q2k8jpws9flml11pxyys19rn0ihd6pis-libressl-3.5.3.tar.gz
source root is libressl-3.5.3
setting SOURCE_DATE_EPOCH to timestamp 1652669711 of file libressl-3.5.3/config.sub
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
patching script interpreter paths in tests/
tests/testssl: interpreter directive changed from "#!/bin/sh" to "/nix/store/m6pqblbr77ady86apyl7ickafgprjd9f-bash-5.1-p16/bin/sh"
tests/ssltest.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/m6pqblbr77ady86apyl7ickafgprjd9f-bash-5.1-p16/bin/sh"
/**
* Typically when we think of map we think of lists. Let's take the ML notation
* for map of a list:
*
* ((a -> b) -> List a -> List b)
*
* With ML notation, the best way to read this is that the last arrow is the
* return type. The reason the notation exists this way is because functions in
* a functional language can be modeled as unary, or meaning they only have one
* argument. One can imagine multiple argument functions as sytactic sugar.
@LoganBarnett
LoganBarnett / use-fork.sh
Last active May 19, 2020 21:43
Switch to using a git fork. Original "origin" becomes "upstream".
#!/usr/bin/env bash
# -*- shell-mode -*-
if [ "$1" == "" ]; then
echo "Usage: use-fork <forked clone URL>"
exit 1
fi
# Go to the repo involved and click fork
original_url="$(git remote get-url origin)"
const R = require('ramda')
const fs = require('fs').promises
const headers = [
'Device',
'Serial Number',
'Device Timestamp',
'Record Type',
'Historic Glucose mg/dL',
'Scan Glucose mg/dL',
const fs = []
for(var i = 0; i < 3; ++i) {
fs.push(() => console.log(i))
}
fs.forEach(f => f())
// with explicit scope
const fs = []
const scope = { i: 0 }
// f is the function - it takes a single element of the array and returns a new element
function map(f, array) {
var newArray = []
for(var i = 0; i < array.length; ++i) {
var oldItem = array[i]
var newItem = f(oldItem)
newArray.push(newItem)
}
return newArray
}
@LoganBarnett
LoganBarnett / killer-queen-rep-graph.org
Created August 23, 2018 21:19
My graph for doing timed reps (successful executions performed in 60 seconds) for Killer Queen.

timed reps

timestd sticksrt sticklng stickbanjoloopslazy-jstablejjump-scrape
<2018-02-01 Fri>2015103200??
<2018-03-01 Fri>2416111200??
<2018-04-01 Fri>2518272200??
<2018-05-01 Fri>40493137568??
<2018-05-07 Fri>336034304711??