Skip to content

Instantly share code, notes, and snippets.

@isomorphisms
isomorphisms / quintic.dance.R
Last active August 29, 2015 14:15
roots of polynomials: watch the commutator, permutations, braids, as you twiddle the roots
#OUTPUT: https://twitter.com/isomorphisms/status/566965475188670464
#AFTER: https://www.youtube.com/watch?v=RhpVSV6iCko
#ORIGIN: V. I. Arnol'd
#main parts are:
# — polyroot
# — concatenation of the list called "dance"
#!/bin/bash
shopt -s expand_aliases
alias log='tee -a productivity.log; date >> productivity.log'
finished()
#!/bin/bash
finished()
{
echo -e "\n\nDone!"
exit $?
}
trap finished SIGINT
@isomorphisms
isomorphisms / .bash_aliases.bash
Last active August 29, 2015 14:10
commands I wanted which didn't (exactly) exist
#IMPORTANT
alias del='gvfs-trash'
alias rm='rm -i'
alias mv='mv -i'
@isomorphisms
isomorphisms / how.to.strikethrough
Last active July 7, 2016 15:05
Flag flabby sentences.
Unicode[edit]
Combining characters[edit]
In plain text scenarios where markup cannot be used, Unicode offers a number of
combining characters that achieve similar effects.
The “combining long stroke overlay” (U+0336) results in an unbroken stroke
across the text:
@isomorphisms
isomorphisms / b'aktun.R
Created November 19, 2014 18:26
Mayan long count times in lubridate
require(lubridate)
`k'in` <- ddays(1)
winal <- 20 * `k'in`
tun <- 18 * winal
`k'atun` <- 20 * tun
`b'aktun` <- 20 * `k'atun`
piktun <- 20 * `b'aktun`
kalabtun <- 20 * piktun
kinichiltun <- 20 * kalabtun
alautun <- 20 * kinichiltun
#!/usr/bin/perl -s
#########################################################################
#
# TTYtter v2.1 (c)2007-2012 cameron kaiser (and contributors).
# all rights reserved.
# http://www.floodgap.com/software/ttytter/
#
# distributed under the floodgap free software license
# http://www.floodgap.com/software/ffsl/
#
#!/bin/bash
# imgur script by Bart Nagel <bart@tremby.net>
# version 4
# I release this into the public domain. Do with it what you will.
# Required: curl
#
# Optional: xsel or xclip for automatically putting the URLs on the X selection
# for easy pasting
@isomorphisms
isomorphisms / catalan.R
Last active August 29, 2015 14:08
the Catalan numbers: recursive formula for # binary trees, # triangulations of a polygon, and more
catalan <- function(n) {
#make a memo
if (!exists('cat.save') || length(cat.save) < n) { cat.save <<- integer(n) }
#actual catalan function
#base layer
if (n==0) 1
@isomorphisms
isomorphisms / yaron.md
Last active August 29, 2015 14:07
Yaron Minsky quotes

What I don’t like about object-oriented languages: there are three key ideas that came out of the OO paradigm—one great, one good-but-flawed, one terrible.

  • The great idea is abstraction: interfaces.
  • The good idea with the wrong default is subtyping. Subtyping is nice—sometimes you want it—but parametric polymorphism is the right default. Think about a function like list.map—you want to have an α list, and then a function that takes α→β. You don’t want to have an object list, and then a function that takes object→object. That’s just wrong.

These mis-features, combined with the verbosity of the languages, make it hard to abstract out simple functions.