This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# initial run instructions: | |
# | |
# brew install evernote-backup | |
# evernote-backup init-db | |
# sync to latest | |
evernote-backup sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add the initial tiles | |
this.grid.insertTile(new Tile({x:3,y:0}, 2**1)); | |
this.grid.insertTile(new Tile({x:2,y:0}, 2**1)); | |
this.grid.insertTile(new Tile({x:1,y:0}, 2**2)); | |
this.grid.insertTile(new Tile({x:0,y:0}, 2**3)); | |
this.grid.insertTile(new Tile({x:0,y:1}, 2**4)); | |
this.grid.insertTile(new Tile({x:1,y:1}, 2**5)); | |
this.grid.insertTile(new Tile({x:2,y:1}, 2**6)); | |
this.grid.insertTile(new Tile({x:3,y:1}, 2**7)); | |
this.grid.insertTile(new Tile({x:3,y:2}, 2**8)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am captainpete on github. | |
* I am captainpete (https://keybase.io/captainpete) on keybase. | |
* I have a public key whose fingerprint is 108B 0A12 F415 0AC4 EDD7 17AB 16D5 D511 A1ED DA5B | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pry' | |
require 'set' | |
# disk UUID | |
# find with `diskutil corestorage list` | |
UUID = "1D1D6CEB-4613-472C-AE71-BD50651D44D1" | |
SUFFIXES = [ '', '!!', '123' ] | |
JOINS = [ '', ',', ', ' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# infnoise | |
# | |
# Feed entropy pool using the Infinite Noise TRNG | |
description "Infinite Noise" | |
start on filesystem or runlevel [2345] | |
stop on runlevel [!2345] | |
respawn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/sbin/openrc-run | |
description="infnoise - Feed entropy pool using the Infinite Noise TRNG" | |
pidfile="/var/run/infnoise.pid" | |
command="/usr/local/sbin/infnoise" | |
command_args="--dev-random" | |
start_stop_daemon_args="--make-pidfile --background" | |
depend() { | |
before urandom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
anaglyph.plot <- function(x,y,z,left="red",right="cyan",depth="med",style="pop-out",type="p",...) { | |
if (depth=="low") { | |
scale <- 0.1 | |
} else if (depth=="med") { | |
scale <- 0.2 | |
} else if (depth=="high") { | |
scale <- 0.5 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Whiteboard photo cleanup script | |
# inspired by https://gist.github.com/lelandbatey/8677901 | |
# converts an image to png, extracts strokes, traces etc. | |
whiteboard() { | |
convert "$1" "$1.converted.png" | |
echo "Converted" | |
convert "$1.converted.png" \ | |
-morphology Convolve DoG:15,100,0 \ | |
-negate -normalize -blur 0x1 -channel RBG \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If installing Rubinius 2.2.6 fails | |
# with an error containing 'rl_username_completion_function' | |
ruby-install rbx 2.2.6 # <= fails | |
# Remove and re-extract Rubinius | |
cd ~/src && rm -fr rubinius-2.2.6 && tar -xf rubinius-2.2.6.tar.bz2 | |
# Make sure LLVM is installed | |
brew install llvm | |
# Make sure the other libs are present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from the momentjs calendar function | |
# Inspired by this answer: http://stackoverflow.com/a/10306813/325676 | |
moment.fn.calendarTitle = -> | |
calendar = | |
sameDay : '[Today]', | |
nextDay : '[Tomorrow]', | |
nextWeek : 'dddd, Do MMM', | |
lastDay : '[Yesterday]', | |
lastWeek : '[Last] dddd', |
NewerOlder