Skip to content

Instantly share code, notes, and snippets.

@hishma
hishma / just_another_afternoon_spec.rb
Created July 31, 2012 23:53
just another afternoon spec
describe "just another afternoon” do
jeff = Factory.create(:loser)
artie = Cat.new(:name => "Artie", :size => "long", :color => "black”)
helpeless_victim = Victim.new(:type => ['Mouse, 'Bird', 'Mole', 'Rat'].sample)
artie.catch(helpless_victim)
while helpeless_victim.is_alive?
artie.torture(victim)
sleep 10
@hishma
hishma / random word
Created October 27, 2011 16:55
Copy a random word to the clipboard
sed `perl -e "print $RANDOM"`"q;d" /usr/share/dict/words | tr -d '\n' | pbcopy
@hishma
hishma / setTitleToVersionName.applescript
Created July 13, 2011 15:24
Copy the Aperture Version Name to the IPTC ObjectName (Title field in Aperture)
-- Copy the Aperture Version Name to the IPTC ObjectName (Title field in Aperture)
tell application "Aperture"
set selectedImages to (get selection)
if selectedImages is {} then
error "Please select an image."
else
repeat with i from 1 to count of selectedImages
tell library 1
tell item i of selectedImages
@hishma
hishma / ViewAperturePhotoOnFlickr.applescript
Created July 13, 2011 15:16
View an Aperture photo on flickr
-- View an Aperture photo on flickr
-- Assumes a custom metadata field in Aperture named "Flickr URL" exists.
tell application "Aperture"
-- selection always returns image versions
set selectedImages to (get selection)
if (count of items in selectedImages) > 0 then
repeat with i from 1 to count of selectedImages
tell library 1
set img to item i of selectedImages