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
# Arcify | |
class Arcify < Processing::App | |
class Arc | |
attr_accessor :id | |
def initialize x,y,r,s,f,i | |
@x = x | |
@y = y | |
@r = r | |
@s = s |
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
# Treelike | |
# livecoding practice, 2010-06-17, 40min | |
# going for something like a tree. This isn't exactly what I | |
# saw in my brain when I started, but it's interesting. | |
# especially when the @d value starts getting very small. | |
# image at http://www.flickr.com/photos/16913236@N04/4710032223/ | |
class Treelike < Processing::App | |
class Leaf |
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
# Blankslate - livecoding practice start file | |
class Blankslate < Processing::App | |
def setup | |
end | |
def draw | |
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 | |
def notify(msg) | |
puts "[#{ Time.now.strftime "%H:%M:%S" }]: #{msg}" | |
`notify-send -i /home/adam/Documents/images/icons/pomodoro.png "Pomodoro" "#{msg}"` | |
end | |
POMODORO = ARGV.size > 0 ? ARGV[0].to_i : 25 | |
REST = ARGV.size > 1 ? ARGV[1].to_i : 5 | |
if ARGV.length > 2 |
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
# Circle Grid | |
# https://picasaweb.google.com/adam.bachman/LivecodePractice20100618 | |
require 'ostruct' | |
class CircleGrid < Processing::App | |
def setup | |
background 255 | |
ellipse_mode CENTER | |
stroke_width 20 | |
frame_rate 30 |
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
# Simpler, idiomatic Ruby for extending Rails. | |
# | |
# http://yehudakatz.com/2009/11/12/better-ruby-idioms/ | |
# | |
module Yaffle | |
# any method placed here will apply to classes, like Hickwall | |
def acts_as_yaffle | |
send :include, InstanceMethods | |
end |
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
/* | |
2010-08-12 #standup | |
The Practical Difference Between Function Statements and Function Expressions | |
jslint tells me this is illegal: | |
*/ | |
$(function () { |
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
- form_for @screen do |f| | |
- Asset.all.each do |asset| | |
%label | |
= check_box_tag 'screen[asset_ids][]', asset.id, @screen.asset_ids.include?(asset.id) | |
= asset.name | |
= f.submit | |
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
// javascript functions are not closures. They do not behave in the way I would expect. | |
var funcs = []; | |
for (var i=0; i < 10; i++) { | |
funcs.push(function() { document.writeln(i); }); | |
} | |
for (var n=0; n < 10; n++) { | |
funcs[n](); | |
} |