Skip to content

Instantly share code, notes, and snippets.

View amonks's full-sized avatar
🐋
🐟🐠🐡

Andrew Monks amonks

🐋
🐟🐠🐡
View GitHub Profile
// bookmarklets work because when you click link that starts with `javascript:`,
// instead of following the link, the browser executes the javascript.
javascript:
// get the <body> element, store it in a variable for later
var bodyTag = document.getElementsByTagName("body")[0];
// I want to use jQuery in my bookmarklet, so first I'll make a <script> element for it
var script = document.createElement("script");
// then I'll set the <script src=""> to jquery's url
#!/usr/bin/env ruby
require 'rubygems'
require 'roo'
pwd = File.dirname(__FILE__)
Dir.glob("#{pwd}/*.xls") do |file|
file_path = "#{pwd}/#{file}"
file_basename = File.basename(file, ".xls")
xls = Roo::Excel.new(file_path)
@amonks
amonks / gestures.md
Created May 14, 2014 18:38
final paper

Motion Control

Human Machine Interaction / Andrew Monks

Intro

I'm personally super excited about realtime 3d gesture sensors like the Kinect or the LeapMotion.

I don't think there's an established name for this category of devices yet, so I'm gonna use the more general term, Motion Controllers as a synechdoche for the smaller subset of devices I'm talking about.

;here's the main function, it uses 'map' which we define below
(define (make-circles list-of-colors)
(my-map (lambda (color)
(circle 12 'solid color))
list-of-colors
))
;replacement for built-in 'map' function
(define (my-map f lst)
(cond
(define (longer-than n list-of-strings)
(map (lambda (string)
(cond
[(< n (string-length string)) string]
[else null]
))
list-of-strings
)
)
require 'sinatra'
require 'slim'
get '/' do
@n = 10
slim :items
end
get '/:n' do
@n = params[:n]
// file of.sublime-build
{
"cmd": ["make"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${project_path:${folder}}",
"selector": "source.c, source.c++",
"variants":
[
{

Response to Magritte reading on Fantômas

Andrew Monks

Personally, the moment in Magritte's response to Fantômas that most interested me was at the end of the coup de theatre when he posited that Fantômas can only be captured by entering his dreams.

His notes were published in 1928, the year after he moved to France and became acquainted with André Breton and joined the surrealist group. André Breton defined the goal of the surrealists as, 'to resolve the previously contradictory conditions of dream and reality into an absolute reality, a super-reality'.

Monument // Andrew Monks

A monument is a celebration of someone’s impact on the world, and of the empty void they leave behind them.

These days, your legacy is manifested as much in intangible media is it is in physical reality.

Celebrate your loved ones with a monument for the digital age.

What is it?