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
# TODO: parameterize query | |
# TODO: paginate google results | |
require 'rubygems' | |
require 'mechanize' | |
require 'json' | |
tweets = [] | |
a = Mechanize.new do |agent| |
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
set :application, 'foo' | |
set :repository, '_site' | |
set :scm, :none | |
set :deploy_via, :copy | |
set :copy_compression, :gzip | |
set :use_sudo, false | |
set :host, '127.0.0.1' | |
role :web, host | |
role :app, host |
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
# TODO | |
# - authentication for admin | |
# - hoptoad/exception_notification | |
# - setup layouts | |
# - any gems? | |
# - any plugins? | |
# - blueprint? | |
# Delete unneeded files | |
run 'rm README' |
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
/** | |
* Make this a "bookmarklet" | |
* 1. Remove the function enclosure | |
* 2. Remove spaces (http://userjs.up.seesaa.net/js/bookmarklet.html) | |
* 3. Add to your browser's bookmarks bar | |
*/ | |
function toggle_showgrid() { | |
var d = Array.prototype.slice.call(document.getElementsByClassName('container')); | |
var id = document.getElementById('container'); | |
if (id) { d.push(id); } |
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 UserMailer < ActionMailer::Base | |
def signup_notification(user) | |
setup_email(user) | |
@subject += "One final step: please activate." | |
@body[:url] = "http://#{user.site.domain}/activate/#{user.activation_code}" | |
@body[:code] = user.activation_code | |
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
class UsersController < ActionController::Base | |
before_filter :login_required | |
def show | |
@user = User.find(params[:id]) | |
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
class User < ActiveRecord::Base | |
# Validation | |
validates_presence_of :password_confirmation | |
# Association | |
has_many :comments | |
# Instance Method | |
def full_name | |
"#{first_name} #{last_name}" | |
end | |
end |
NewerOlder