Skip to content

Instantly share code, notes, and snippets.

View micahbrich's full-sized avatar

Micah Rich micahbrich

View GitHub Profile
class ImagesController < ApplicationController
session :cookie_only => false, :only => :upload_image_block
def upload_image_block
@image = Image.new(:file => swf_upload_data) # here you can use your favourite plugin to work with attachments
if @image.save
render :partial => 'image', :object => @image
else
render :text => "error"
end
require 'fleakr'
class Fetchr < ActiveRecord::Base
# This script fetches flickr photos
@flickr ||= Fleakr.api_key = < my key >
@user ||= Fleakr.user('info@micahrich.com')
@photos ||= @user.sets.first.photos
@photos.each do |photo|