Skip to content

Instantly share code, notes, and snippets.

Only in ../prototype/images/: add_field_button.png
Binary files ../prototype/images/avatar_200x200.jpg and public/images/avatar_200x200.jpg differ
Only in public/images/: avatar_proxied_overlay_182x182.png
Only in public/images/: avatar_proxied_overlay_200x200.png
Only in public/images/: button_left.gif
Only in ../prototype/images/: button_left.png
Only in public/images/: button_right.gif
Only in ../prototype/images/: button_right.png
Only in ../prototype/images/: checkbox_field_icon.png
Only in ../prototype/images/: date_field_icon.png
require 'rubygems'
gem 'rspec'
gem 'plugit'
require 'spec'
require 'plugit'
$LOAD_PATH << File.expand_path("#{File.dirname(__FILE__)}/../lib")
$LOAD_PATH << File.expand_path(File.dirname(__FILE__))
RAILS_ROOT = File.expand_path("#{File.dirname(__FILE__)}/..")
PLUGIT_ENVIRONMENTS_PATH = File.dirname(__FILE__) + '/environments'
# Copyright (c) 2007, Adam Williams and John W. Long.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
module Kernel
def rputs(*args)
puts *["<pre>", args.collect {|a| CGI.escapeHTML(a.inspect)}, "</pre>"]
end
end
namespace :copy do
# Allows for the copy of asset directories from remote environments into the
# corresponding system directory. The download is maintained in your /tmp
# directory, so that subsequent executions will not fetch from the remote
# server unless forced to.
#
# This is extremely useful for developing/debugging migrations, where you'd
# like to focus on just a few assets, and need to re-run the migration many
# times.
# Modified from http://www.elctech.com/articles/rake-routes-review-repeat
namespace :routes do
desc 'Brief listing of routes info plus matches to app controller methods'
task :by_controller => :environment do
task_setup "Attempting to match routes controller methods to app controller methods"
methods = find_routes_controller_methods_matched_to_app_controller_methods(@pattern)
index_width, controller_width, action_width, path_width, method_width, segment_width, app_controller_action = get_array_elements_max_width(methods)
last_controller = ''
@aiwilliams
aiwilliams / gist:617462
Created October 8, 2010 20:20
Purist NS Regexp (Predicate)
NSString *actual = @"actual string";
NSString *regex = @"^actual string$";
NSPredicate *regextest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
BOOL isMatch = [regextest evaluateWithObject:actual];
STAssertTrue(isMatch, @"Expected %@ to match %@", actual, regex);
@aiwilliams
aiwilliams / gist:641035
Created October 22, 2010 17:57
Logging 'char *argv[]'
NSString *printableString = [NSString stringWithUTF8String:*argv];
NSLog(@"Is it broken: %@", printableString);
@aiwilliams
aiwilliams / nginx.conf.example
Created November 20, 2010 16:30
unicorn/nginx dev setup
worker_processes 1;
events {
worker_connections 1024;
accept_mutex off; # "on" if nginx worker_processes > 1
}
http {
include mime.types;
default_type application/octet-stream;
@aiwilliams
aiwilliams / unicorn.rb
Created November 20, 2010 16:32
unicorn config for Rails dev with nginx
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
application_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
preload_app true
worker_processes 1
working_directory application_root
listen File.join(application_root, "tmp/sockets/unicorn.sock"), :backlog => 64