Skip to content

Instantly share code, notes, and snippets.

@purplejacket
purplejacket / mary_oliver_the_gift.txt
Created May 30, 2017 13:42
Poem by Mary Oliver about a Mockingbird who sang Mahler
Mary Oliver: The Gift
I wanted to thank the mockingbird for the vigor of his song.
Every day he sang from the rim of the field, while I picked
blueberries or just idled in the sun.
Every day he came fluttering by to show me, and why not,
the white blossoms in his wings.
So one day I went there with a machine, and played some songs of
Mahler.
The mockingbird stopped singing, he came close and seemed
@purplejacket
purplejacket / nested_has.js
Created May 27, 2017 00:08
Does object x have a particular attribute (object property) either at the top level, or anywhere down the "has-a" object tree
_ = require('lodash');
x = {a: 1, b: {c: 2}, d: {e: 3, f: {g:4}}};
function nestedHas(object, attrib) {
if (_.has(object, attrib)) {
return true;
}
for (let key in _.pickBy(object, _.isObject)) {
if (nestedHas(object[key], attrib)) {
return true;
@purplejacket
purplejacket / tetris.bas
Created April 7, 2017 00:14
Tetris game circa 1996 - QuickBasic
' QBASIC TETRIS PROGRAM
' TYPE 'QBASIC TETRIS' AT THE DOS PROMPT TO RUN
' ONCE IN QBASIC PRESS F5 TO START
' TO QUIT FROM QBASIC TO DOS PRESS ALT-F THEN E
' ORIGINALLY CREATED BY ALEXEY PAJITNOV
' SHS Programming Class, Spring 1996, midd9354@uidaho.edu
' AUTHORS:
' Larry Cragun Kai Middleton Mary Tormey
' Lyf Gildersleeve Dalton Paull Ryan Turner
@purplejacket
purplejacket / molecular_weights.txt
Last active March 28, 2017 17:14
Weight of 1 mole of interesting atoms/molecules/other
1 mole of X weighs ... (Avogadro's constant is 6.0221 x 10^23)
hydrogen 1.00797 g
carbon 12.0107 g
iron 55.845 g
cellulose 162.14 g C6H10O5
uranium 238.02891 g
ATP 507.18 g C10H16N5O13P3 Adenosine Triphosphate
Buckeyball 720.66 g C60
Botox 150000 g C6760H10447N1743O2010S32
@purplejacket
purplejacket / andrey_bovykin_undecidable_diophantine_equation.txt
Last active October 2, 2018 18:50
A diophantine equation that's formally undecidable. 125 symbols long. All variables are integers. Formulated by Andrey Bovykin and an associate. "Recent metamathematical wonders and the question of arithmetical realism" https://cast.itunes.uni-muenchen.de/vod/clips/N5l7c5S3Vm/quicktime.mp4 at the 40 minute mark.
∀m ∃N ∀a,b ∃c,d,A,X ∀x,y ∃B,C,F ∀f,g ∃h,i,l,n,r,p,q
x * (y + B - x) * (A + m + B - y)
* [(((f - A)^2 + (g - 1)^2) * (f - B)^2 + (g - x)^2)
* ((f - C)^2 + (g - y)^2 - h - 1)
* (d * g * i + i - c + f)^2
+ (f + h - d * g)^2
+ (B + l + 1 - C)^2
+ (C + n - N)^2
+ (F + r - b * (B + C^2))^2
+ (b * p * (B + C^2) + p - a + F)^2
@purplejacket
purplejacket / gist:1e0f00331121eaaf161732b6c0c90410
Last active February 6, 2017 04:39 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@purplejacket
purplejacket / williams_defender_settings.txt
Last active April 16, 2023 05:24
Williams Defender Settings -- of particular interest are Functions 08, 17, 18, 19, 21: bonus ship level, free play, start difficulty, progressive difficulty, planet restore frequency
BOOKKEEPING AND EVALUATION TOTALS (Functions 1-7)
=================================================
1. In game over mode, set switch to AUTO-UP and depress ADVANCE. The CRT
indicates Function 1 and total left chute coins.
2. Record audit totals and depress ADVANCE for functions 1-7. To review a
total that has been advanced past, set switch to MANUAL-DOWN and depress
ADVANCE. Functions are displayed one at a time as follows:-
Function Total Description
--------------------------------
@purplejacket
purplejacket / for_the_love_of_money.txt
Last active December 10, 2016 06:12
For the Love of Money - Queen Latifah - New Jack City
♪ Another brother wants to win the hustler-of-the-year award ♪
♪ HOW MANY BENZES AND BMs can one man afford? ♪
♪ it ain't just him -- it's also you and you and that guy ♪
♪ who won't be satisfied ♪
♪ 'til all of us is gettin' high ♪
♪ one hit for her, she's pullin' down your drawers ♪
♪ one hit for him, his welfare check is yours ♪
♪ it ain't nothing but a small thing in a big city, see ♪
♪ you're living for the money, B ♪
♪ don't let money change you ♪
****************************************************************************
*
* Program: al_adhoc.prg
*
* Authors: Kai Middleton
*
* Written: 8-87
*
*
* Function: generate a report on up to eleven fields
require 'dictionary'
describe Dictionary do
before do
@d = Dictionary.new
end
it "should be empty when created" do
@d.words.should == []
end