Skip to content

Instantly share code, notes, and snippets.

View cfdrake's full-sized avatar

Colin Drake cfdrake

View GitHub Profile
@cfdrake
cfdrake / oop.swift
Created March 22, 2016 00:21
Inventing Objects
//: Inventing Objects: A Playground exploring the creation of a simple object pattern
//
// Demonstrates:
// - Message Passing
// - Encapsulation
// - Composition/Inheritance/Delegation
// - Open Recursion (...in a crummy way...)
// - Encapsulated, mutable state
import Foundation

Keybase proof

I hereby claim:

  • I am cfdrake on github.
  • I am cfdrake (https://keybase.io/cfdrake) on keybase.
  • I have a public key ASBl8RnKSX2-ovDUTxGysMUBjuGRUDYifnnvq5lukHhRego

To claim this, I am signing this object:

//: Playground - noun: a place where people can play
/// A type which is buildable and appendable from a zero value.
protocol Monoid {
/// Returns the zero value.
static func empty() -> Self
/// Appends one Monoid value to another.
func append(_ m: Self) -> Self
}
@cfdrake
cfdrake / pure.zsh-theme
Last active April 26, 2017 17:45
A minimally modified kasperisager/zsh-pure
#!/usr/bin/env zsh
# ------------------------------------------------------------------------------
#
# Pure - A minimal and beautiful theme for oh-my-zsh
#
# Based on the custom Zsh-prompt of the same name by Sindre Sorhus. A huge
# thanks goes out to him for designing the fantastic Pure prompt in the first
# place! I'd also like to thank Julien Nicoulaud for his "nicoulaj" theme from
# which I've borrowed both some ideas and some actual code. You can find out
@cfdrake
cfdrake / gaggia.md
Created April 2, 2017 23:31
Operating the Gaggia Classic

Gaggia Classic

Buttons

  • Left: POWER
    • Lights up when ON.
  • Middle: ESPRESSO/STEAM MODE TOGGLE
    • Up is espresso mode, down is steam mode.
  • Right: BREW
    • Will light up when the machine is ready/warmed up enough to perform the operation that the MODE button is in. The light does not mean that it is "on" or doing anything per-se, but rather "ready".
@cfdrake
cfdrake / focused.css
Last active April 21, 2017 21:41
"Focused" Theme for Standard Notes
/* Dim tags in editor view. */
#editor-title-bar .editor-tags .tags-input {
color: rgba(0,0,0,0.23) !important;
}
/* Hide note previews in list view. */
.app .notes .note .note-preview {
display: none !important;
}
void setup() {
// Set window size.
size(600, 600);
// Use for high def monitors.
pixelDensity(2);
// Turn off looping draw(), only run once.
noLoop();
}
@cfdrake
cfdrake / vimeo.txt
Created December 13, 2020 03:30
Angel Tears Forever Vimeo Embeds
{{< top-aligned-video id="477427614" height="518" img="https://i.vimeocdn.com/video/1014202042_480.jpg" >}}
{{< top-aligned-video id="476969261" height="518" img="https://i.vimeocdn.com/video/1014202292_480.jpg" >}}
{{< top-aligned-video id="476969354" height="395" img="https://i.vimeocdn.com/video/1014202537_480.jpg" >}}
{{< top-aligned-video id="476969093" height="405" img="https://i.vimeocdn.com/video/1014202968_480.jpg" >}}
{{< top-aligned-video id="477431886" height="425" img="https://i.vimeocdn.com/video/1014203384_480.jpg" >}}
{{< top-aligned-video id="477431946" height="464" img="https://i.vimeocdn.com/video/1014203733_480.jpg" >}}
{{< top-aligned-video id="476969177" height="392" img="https://i.vimeocdn.com/video/1014204029_480.jpg" >}}
{{< top-aligned-video id="476969250" height="459" img="https://i.vimeocdn.com/video/1014204280_480.jpg" >}}
{{< top-aligned-video id="476969148" height="381" img="https://i.vimeocdn.com/video/1014205021_480.jpg" >}}
{{< top-aligned-video id="477431987" height="360" im
@cfdrake
cfdrake / 64.lua
Created January 28, 2021 16:49
glut-64
-- glut64
--
-- granular sampler in progress
-- (currently requires a grid)
--
-- trigger voices
-- using grid rows 2-8
--
-- mute voices and record
-- patterns using grid row 1
-- mouse
-- by @cfd90
MusicUtil = require "musicutil"
hs = require('awake/lib/halfsecond')
engine.name = "PolyPerc"
last_x = 4
last_y = 4