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
# outtolunch_template | |
file 'config/routes.rb', <<-CODE | |
ActionController::Routing::Routes.draw do |map| | |
end | |
CODE | |
file 'config/initializers/uri_ext.rb', <<-CODE | |
URI::PATTERN::UNRESERVED.replace("+-_.!~*'()a-zA-Z\\d") | |
CODE |
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
(function($) { | |
$.fn.defaultvalue = function() { | |
// Scope | |
var elements = this; | |
var args = arguments; | |
var c = 0; | |
return( | |
elements.each(function() { | |
$(this).css('color', '#aaa'); |
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
require 'capistrano/version' | |
load 'deploy' | |
# Customize the following variables | |
set :domain, "host.example.com" | |
set :user, "username" | |
set :application, "my_wordpress_blog" | |
set :deploy_to, "/var/www/apps/#{application}" | |
# These variables probably don't need to change |
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
task :deploy do | |
`rsync -rltvz -e ssh . deploy@hostname:/var/www/apps/my_app` | |
`ssh deploy@hostname touch /var/www/apps/my_app/public/restart.txt` | |
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
module ActiveRecord | |
class Errors | |
# Redefine the ActiveRecord::Errors::full_messages method: | |
# Returns all the full error messages in an array. 'Base' messages are handled as usual. | |
# Non-base messages are prefixed with the attribute name as usual UNLESS they begin with '^' | |
# in which case the attribute name is omitted. | |
# E.g. validates_acceptance_of :accepted_terms, :message => '^Please accept the terms of service' | |
def full_messages | |
full_messages = [] |
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
;; Experimental theme by Geoffrey Grosenbach | |
;; | |
;; SCREENSHOT: http://blog.peepcode.com/tutorials/2009/ruby-emacs-flog | |
;; | |
;; USAGE: | |
;; Copy to your emacs config directory, load it, and activate. | |
;; | |
;; ;; Requires the color-theme package: | |
;; (add-to-list 'load-path (concat dotfiles-dir "/vendor/color-theme")) | |
;; (require 'color-theme) |
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
;; emacs-key-bindings.el - bindings that make life easier | |
(global-set-key (kbd "C-c b") 'eval-buffer) | |
(global-set-key (kbd "C-x f") 'recentf-ido-find-file) | |
(global-set-key (kbd "M-s") 'save-buffer) | |
(global-set-key (kbd "M-z") 'undo) | |
;; set line commenting to textmate style | |
(global-set-key (kbd "M-/") 'comment-or-uncomment-region) | |
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
;; custom for ubuntu | |
(setq gem_home "/home/mig/.gem") | |
(setenv "GEM_HOME" gem_home) | |
;; Swap alt and meta in emacs | |
; (setq x-super-keysym 'meta) | |
(setq x-select-enable-clipboard t) | |
(setq interprogram-paste-function 'x-cut-buffer-or-selection-value) |
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
(function ($) { | |
// Monkey patch jQuery 1.3.1+ css() method to support CSS 'transform' | |
// property uniformly across Webkit/Safari/Chrome and Firefox 3.5. | |
// 2009 Zachary Johnson www.zachstronaut.com | |
function getTransformProperty(element) | |
{ | |
// Try transform first for forward compatibility | |
var properties = ['transform', 'WebkitTransform', 'MozTransform']; | |
var p; | |
while (p = properties.shift()) |
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 Object | |
cattr_accessor :current_test | |
end | |
module Minispec | |
class TestClass | |
def self.prepare(desc) | |
name = name_for_class(desc) | |
Class.new(base_test_class(name)) do | |
define_singleton_method(:name) { name } |