Skip to content

Instantly share code, notes, and snippets.

View twopoint718's full-sized avatar
yo

Christopher Wilson twopoint718

yo
View GitHub Profile
@twopoint718
twopoint718 / script.sh
Created March 4, 2019 15:26
Nokogiri on MacOS Mojave (10.14)
gem install nokogiri -- \
--use-system-libraries \
--with-iconv-dir=$(brew --prefix libiconv) \
--with-xml2-include=$(brew --prefix libxml2)/include/libxml2
@twopoint718
twopoint718 / address_person.sql
Created February 25, 2019 21:42
Bidirectional foreign key constraints
create table address (
address_id serial primary key,
person_id integer
);
create table person (
person_id serial primary key,
address_id integer
);
@twopoint718
twopoint718 / gps.txt
Created February 9, 2019 22:11
GPS data
$GPRMC,212758.000,A,4304.2770,N,08925.9501,W,0.00,350.98,090219,,,D*7C
$GPGGA,212759.000,4304.2770,N,08925.9501,W,2,8,1.06,281.5,M,-34.2,M,0000,0000*64
$GPGSA,A,3,27,16,30,07,09,23,08,26,,,,,1.39,1.06,0.89*0D
$GPGSV,3,1,10,09,62,251,45,27,56,097,40,23,50,192,32,08,50,154,36*7B
$GPGSV,3,2,10,07,47,303,48,16,41,051,28,51,37,205,36,26,16,060,28*70
$GPGSV,3,3,10,30,15,293,32,05,03,328,23*78
$GPRMC,212759.000,A,4304.2770,N,08925.9501,W,0.02,350.98,090219,,,D*7F
@twopoint718
twopoint718 / SketchSystems.spec
Last active June 17, 2019 21:07
Text Attributes&
Text Attributes&
Bold
Bold Off
bold -> Bold On
Bold On
bold -> Bold Off
Italic
Italic Off
italic -> Italic On
@twopoint718
twopoint718 / Reader.re
Last active November 26, 2018 01:28
Reader implementation in ReasonML. Possible uses as an alternative to something like a Redux store?
type t('r, 'a) = 'r => 'a;
let pure = (x, _) => x;
let map = (f, r, k) => f(r(k));
let apply = (f, r, k) => {
let f' = f(k);
let r' = r(k);
f'(r');
};
let join = (f, x) => f(x, x);
STEPS
Dashboard
my clients -> My Clients
new client -> Add New Client
My Clients
client *needs help* -> Client Workplan
client *everyone else* -> Client Workplan
add new client -> Add New Client
@twopoint718
twopoint718 / Person.js
Created July 8, 2018 03:09
Objects two ways
// Generated by BUCKLESCRIPT VERSION 3.1.5, PLEASE EDIT WITH CARE
'use strict';
var CamlinternalOO = require("bs-platform/lib/js/camlinternalOO.js");
var shared = [
"name",
"age"
];
@twopoint718
twopoint718 / RandomEnum.hs
Created June 3, 2018 18:05
Select a random element of a bounded, enumerable datatype. If you know that a datatype has a way to generate a list of items, a way to determine the minimum and maximum values, then you should be able to select a random element from that datatype.
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
module RandomEnum where
import System.Random
enumRandomR :: (RandomGen g, Enum e) => (e, e) -> g -> (e, g)
@twopoint718
twopoint718 / beyond_just_tdd.md
Created May 11, 2018 21:01
Slides from my Madison+Ruby Chicago talk. Given May 11, 2018 (I draw _heavily_ on the references; they're excellent. Go check them out!)

Beyond Just TDD

original

^ Thanks, other speakers!

^ Talk is "Beyond Just TDD" but not "just" more like just. Good just. Don't get the idea I'm anti-test. Please test your code!

^ I've learned that a good talk begins with a personal story -- so let's get right to the material. I've tried to leave out code entirely, but there's one slide. But it's short. I think you won't mind.


@twopoint718
twopoint718 / Nats.hs
Created January 30, 2018 21:05
Implementation of Peano integer arithmetic and a few "binary peano" operations
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Nats where
import Prelude hiding (even, odd)
import GHC.Real (Ratio(..))
import Test.SmallCheck
import Test.SmallCheck.Series