Skip to content

Instantly share code, notes, and snippets.

View zeke's full-sized avatar
🍊
Busy! @-message me directly if I'm slow to respond.

Zeke Sikelianos zeke

🍊
Busy! @-message me directly if I'm slow to respond.
View GitHub Profile
@Visuelle-Musik
Visuelle-Musik / jr_midi_io_solresol.rb
Created September 19, 2009 22:27
MIDI I/O with JRuby, ruby-processing example 1
# === MIDI-Notes to solresol-colours in RubyProcessing. Example for the use of JRmidi, very basic Midi-Implementation for JRuby, especially for use with ruby-processing ===
# --- ruby-processing see: http://wiki.github.com/jashkenas/ruby-processing / solresol is a universal language, where words can be put out as musical notes, colours or other ---
# --- solresol see: http://en.wikipedia.org/wiki/Solresol ---
# Notes have to come as MIDI-note-events from MIDI-in, and are so we can hear them redirected to a synth as well
# ! ==> adopt your MIDI-ports below !!!!
MIDI_PORT_IN = 0 # your MIDI-input where notes will be mapped to coulors
MIDI_PORT_OUT = 11 # select this port so, that is redirected to MIDI-in by hardware, with JACK, ableton live or something (ports are numbered from 0 to n, no difference if in or out)
MIDI_OUT_SYNTH = 9 # the OS-System's synth, port number may differ on your system
@ismasan
ismasan / phantom_js_url_cycle.js
Created May 15, 2011 15:24
Super easy web screen scraping with Phantom.js. Screenshots example.
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Cycle array of URLs and process with phantom.js (http://www.phantomjs.org/)
Adds Array.prototype.forEachWebPage() iterator.
EXAMPLE:
Save screenshots. Command line:
phantomjs phantom_js_url_cycle.js ./screenshots
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
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
@zobar
zobar / gist:1499822
Created December 20, 2011 01:39
Running a Cinch IRC bot on Heroku
  1. Add Heroku to your Gemfile and bundle install.
  2. Create your Heroku app. This will only work with their (currently-beta) 'cedar' stack, so you have to heroku create --stack=cedar.
  3. Create a Procfile for your bot. This tells Heroku how to run your worker. In our case, the bot is bot.rb, so the only line in the Procfile is cinch: bundle exec ./bot.rb
  4. Commit and push to Heroku.
  5. You do not want a Web worker running, so heroku scale web=0 cinch=1. This also sets up your deployments to restart the bot.
@mathias
mathias / buttons.coffee
Created January 30, 2012 15:31
Haml + Coffeescript Tweet button and Like button
((d, s, id) ->
js = undefined
fjs = d.getElementsByTagName(s)[0]
return if d.getElementById(id)
js = d.createElement(s)
js.id = id
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"
fjs.parentNode.insertBefore js, fjs
) document, "script", "facebook-jssdk"
@zeke
zeke / 0_silent_selector_grid.scss
Created May 16, 2012 06:42 — forked from chriseppstein/0_silent_selector_grid.scss
This gist describes a new feature we're experimenting with for Sass 3.2: placeholder selectors. They do not get generated into your output, but they can be used like a class and extended like one.
$gutter: 10px;
$grid-unit: 60px;
%clearfix {
*zoom: 1;
&:after {
content: "\0020";
display: block;
height: 0;
clear: both;
@jclem
jclem / gifify.sh
Last active December 11, 2015 16:19
Shell script for turning .mov files into .gifs and posting to Cloudapp
#!/bin/bash
function printHelpAndExit {
echo 'Usage:'
echo ' gifify -coux filename'
echo ''
echo 'Options: (all optional)'
echo ' c CROP: The x and y crops, from the top left of the image, i.e. 640:480'
echo ' o OUTPUT: The basename of the file to be output (default "output")'
echo ' u: Upload the resulting image to CloudApp'

What zoom level is equivalent to a given altitude? In other words, if I’m looking at a map at ZL n, how high off the ground would I be to make out the same features?

This is from a question from Eric Fischer; my algebra and arithmetic are extremely rusty, so please check everything! Major assumptions:

  1. We’re at the equator.

  2. We’re looking straight down (which you can’t realistically do out a plane window, for example).

  3. We have 20/20 vision (which is not as good as median corrected vision).

npm () {
if [ "$1" = "publish" ]; then
dependency-check . && $(which npm) "$@"
else
$(which npm) "$@"
fi
}
@isaacs
isaacs / blerg.js
Last active August 29, 2015 14:10
/**package
{"name":"just-a-gist-package-nbd-whatevs","version":"1.2.3",
"description":"showoff",
"repository":"https://gist.github.com/2e776d98951973c8b857.git"}
**/
module.exports = "just a gist pkg nbd whatevs"