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"
#!/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
<?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] }
- 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
require 'right_aws'
namespace :utils do
namespace :attachments do
task :initialize_s3 => :environment do
s3_config = YAML.load_file(File.join(File.dirname(__FILE__), '/../../config/amazon_s3.yml'))
s3_config = s3_config[RAILS_ENV].to_options
@s3 = RightAws::S3.new(s3_config[:access_key_id], s3_config[:secret_access_key])
end
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
# focus mode
# toggled with http://www.clockwise.ee/gasmask/
0.0.0.0 twitter.com
0.0.0.0 mail.google.com
API Docs: http://tumblr.com/api
# 1. Register an app
http://tumblr.com/oauth/apps
# 2. Get an OAuth request token
sudo easy_install oauth2
https://gist.github.com/3556495