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
SYSTEM_DEPENDENCIES = ["ruby", "rake", "gem"] | |
GEM_DEPENDENCIES = ["redis", "resque"] | |
def dependency_check(who) | |
if(system("which #{who}")) | |
puts "#{who} installed." | |
else | |
puts "#{who} missing." | |
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
require 'pathname' | |
require 'fileutils' | |
# @a = "/Users/dave/Desktop/hq-feeder/test-dirs/" | |
# @b = "/Users/dave/Desktop/hq-feeder/test-dirs2/" | |
# EXPORT_DIR = "/Users/dave/Desktop/hq-feeder/test-export-dirs/" | |
class ImageLoader | |
attr_reader :files |
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
class Book | |
attr_accessor :title | |
attr_reader :isbn | |
attr_writer :owner | |
end | |
# This is identical to | |
class Book | |
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
# Define an image as below, you can call it anything, and you can have several -- e.g. ActiveRegion_AIA171, ActiveRegion_AIA090 | |
class ActiveRegionImage < Image | |
layer :id => 1, :visible => :true, :opacity => 100 | |
types ["mobile","web"] | |
scale 2.63 | |
end | |
class ActiveRegionMovie < Movie | |
layer :id => 1, :visible => :true, :opacity => 100 | |
types ["mobile","web"] |
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 'image' | |
require 'movie' | |
require 'event_registry' | |
class HelioEvent | |
EVENT_STARTTIME_KEY = "event_starttime" | |
EVENT_ENDTIME_KEY = "event_endtime" | |
EVENT_ARCHIVEDATE_KEY = "kb_archivdate" | |
EVENT_UID_KEY = "kb_archivid" | |
EVENT_BBOX_KEY = "hpc_bbox" |
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
# More ruby fun! | |
def power(base) | |
Proc.new {|x| base ** x } | |
end | |
base2 = power(2) # => #<Proc:0x00000001001569d0@-:4> | |
base2.call(8) # => 256 |
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
[user] | |
name = Dave Lyon | |
email = dave@davelyon.net | |
[diff] | |
external = "mate" | |
[core] | |
editor = "mate -wl1" | |
excludes = "/Users/dlyon/.gitignore" |
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
var fortunes=new Array(" One learns to itch where one can scratch. -- Ernest Bramah "," One meets his destiny often on the road he takes to avoid it. "," One monk said to the other, \"The fish has flopped out of the net! How will it live?\" The other said, \"When you have gotten out of the net, I'll tell you.\" "," Only that in you which is me can hear what I'm saying. -- Baba Ram Dass "," Only those who leisurely approach that which the masses are busy about can be busy about that which the masses take leisurely. -- Lao Tsu "," Paradise is exactly like where you are right now ... only much, much better. -- Laurie Anderson "," Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away. -- Antoine de Saint-Exupery "," Perhaps the biggest disappointments were the ones you expected anyway. "," Philosophy will clip an angel's wings. -- John Keats "," Push where it gives and scratch where it itches. "," Reality always seems harsher in the early morning. ", |
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
cp $2 "$1/$2" | |
cd $1 | |
# Run with . ./test.sh $DIR_TO_CP_TO $FILE |
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 'plist' | |
r = Plist::parse_xml("/Users/dave/Desktop/ItunesLibrary.xml") | |
lib = Hash.new() | |
r["Tracks"].each do |track| | |
album = track[1]["Album"] |