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
require 'rubygems' | |
require 'sinatra' | |
require 'datamapper' | |
require 'dm-paperclip' | |
require 'haml' | |
require 'fileutils' | |
APP_ROOT = File.expand_path(File.dirname(__FILE__)) | |
DataMapper::setup(:default, "sqlite3://#{APP_ROOT}/db.sqlite3") |
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
# Create a class that has all the members of the hash passed it as member parameters | |
class Hashit | |
def initialize(hash) | |
hash.each do |k,v| | |
self.instance_variable_set("@#{k}", v) ## create and initialize an instance variable for this key/value pair | |
self.class.send(:define_method, k, proc{self.instance_variable_get("@#{k}")}) ## create the getter that returns the instance variable | |
self.class.send(:define_method, "#{k}=", proc{|v| self.instance_variable_set("@#{k}", v)}) ## create the setter that sets the instance variable | |
end | |
end | |
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
set :application, "application" | |
set :user, 'deploy' | |
set :group, 'admin' | |
set :server_name, "adamelliot.com" | |
set :server_alias, "*.adamelliot.*" | |
set :git_server, "git.warptube.com" | |
ssh_options[:port] = 22 | |
# You shouldn't need to change anything past this point, unless you are |
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 | |
# | |
# IP Announce - Adam Elliot <adam@warptube.com> | |
# http://adamelliot.com/ | |
# | |
require 'net/smtp' | |
MAIL_SERVER = 'shawmail.ed.shawcable.net' | |
DOMAIN_NAME = 'adamelliot.com' |
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 | |
# | |
# Check Sites - Adam Elliot <adam@warptube.com> | |
# http://adamelliot.com/ | |
# | |
# Original Script: | |
# http://www.bwigg.com/2008/10/ruby-script-to-check-site-availability/ | |
# | |
require 'net/smtp' |
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 -wKU | |
def render_it(x, y, i0, i1) | |
y0 = (x - 40) * 0.05 | |
x0 = (y - 15) * 0.1233 | |
x1 = y1 = 0 | |
6.times do |c| | |
x1 = x0 * x0 - y0 * y0 + i0 | |
y1 = 2 * x0 * y0 + i1 |
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
require 'hotcocoa' | |
require 'hotcocoa/graphics' | |
framework 'qtkit' | |
include HotCocoa::Graphics | |
HotCocoa::Mappings.map :capture_view => :QTCaptureView, :framework => :QTKit do | |
delegating 'view:willDisplayImage:', | |
:to => :will_display_image, |