Skip to content

Instantly share code, notes, and snippets.

View sheatsb's full-sized avatar
💭
I may be slow to respond.

sheatsb

💭
I may be slow to respond.
View GitHub Profile
# SUPER DARING APP TEMPLATE 1.0
# By Peter Cooper
# Link to local copy of edge rails
inside('vendor') { run 'ln -s ~/dev/rails/rails rails' }
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
# Template created by You've Got Rails (http://www.youvegotrails.com)
gem 'sqlite3-ruby', :lib => 'sqlite3'
gem 'mislav-will_paginate', :lib => 'will_paginate', :source => 'http://gems.github.com'
gem 'activemerchant', :lib => 'active_merchant'
gem 'aws-s3', :lib => 'aws/s3'
gem 'fastercsv'
gem 'hpricot', :source => 'http://code.whytheluckystiff.net'
gem 'thoughtbot-shoulda', :lib => 'shoulda', :source => 'http://gems.github.com'
gem 'RedCloth', :lib => 'redcloth'
#!/usr/bin/env ruby
require 'rubygems'
gem 'rack', '=0.9.1'
gem 'thin', '=1.0.0'
require 'sinatra/base'
## To run this just run thin -R config.ru start
## The default tests pass, allowing the app to start. If the tests failed, the app would not even attempt to start.
##
## Wrap up our sample app in a class, this let's us keep the entire app
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
#
# <VirtualHost *:80>
# ServerName example.com
# ServerAlias *.example.com
# </VirtualHost>
#
# 3) Set the current account from the subdomain
# FacebookConnectMiddleware.py
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from django.conf import settings
import md5
import urllib
import time
import simplejson
from datetime import datetime
<?php
/**
* @package flickrRSS Shortcode
* @author Esther S White
* @version .1
*/
/*
Plugin Name: flickrRSS Shortcode
Plugin URI:
Description: flickrRSS Shortcode adds a shortcode for the <a href="http://eightface.com/wordpress/flickrrss/">flickrRSS plugin</a> by Dave Kellam .
require 'rubygems'
require 'twitter'
base = Twitter::Base.new(Twitter::HTTPAuth.new('username', 'password'))
my_friends = base.friend_ids
candidates = my_friends.inject(Array.new) { |array,id| array += Twitter.friend_ids(id); array }
candidates -= my_friends
tallied = candidates.inject(Hash.new(0)) { |hash, can| hash[can] += 1; hash }
ordered = tallied.sort { |x,y| y[1] <=> x[1] }
#!/usr/bin/env ruby
# This script tweets "I'm listening to ..." via Tweetie
# It gets the information from http://last.fm
# This script is OS X only.
# This script is public domain
# Written by Jeena Paradies <spam@jeenaparadies.net> 2009-07-23
- has_attachment :content_type => :image,
- :thumbnails => {
- :thumb => [80,80],
- :small => '320x320>'
- },
- :storage => :s3,
- :s3_access => :private
+
+ has_attached_file :photo,
+ :styles => {
class ChangePhotoFromAttachmentFuToPaperclip < ActiveRecord::Migration
def self.up
#Reorganise the actual photos on AWS to suit the RWS/Paperclip schema
#Rename attachement_fu columns to paperclip convention
rename_column :photos, :filename, :photo_file_name
rename_column :photos, :content_type, :photo_content_type
rename_column :photos, :size, :photo_file_size
#Remove non-paperclip columns
remove_column :photos, :width