This file contains hidden or 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 last-commit() { | |
git log --format=%H -n 1 | |
} | |
function last-file-change() { | |
git rev-list --max-parents=1 --max-count=1 --format=oneline HEAD -- $1 | cut -d " " -f 1 | |
} | |
function annotate-file() { |
This file contains hidden or 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
namespace :deploy do | |
task :load_schema, :roles => :db, :only => { :primary => true } do | |
rake = fetch(:rake, "rake") | |
rails_env = fetch(:rails_env, "production") | |
migrate_env = fetch(:migrate_env, "") | |
migrate_target = fetch(:migrate_target, :latest) | |
directory = case migrate_target.to_sym | |
when :current then current_path | |
when :latest then latest_release |
This file contains hidden or 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
after_fork do |server, worker| | |
log_path = Rails.root.join('log',"#{Rails.env}.#{worker.nr}.log") | |
new_logger = Logger.new(log_path) | |
new_logger.level = Logger::INFO | |
Rails.logger.flush | |
Rails.logger.close | |
Rails.logger = Rails.application.config.logger = ActiveSupport::TaggedLogging.new(new_logger) |
This file contains hidden or 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
#!/bin/bash | |
startline() { | |
echo "" | |
echo "" | |
echo "---------- $1 -------------------------" | |
echo "" | |
} | |
startline "CPU" |
This file contains hidden or 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
#!/usr/bin/env /Users/fregini/.rbenv/versions/1.9.2-p318/bin/ruby | |
# | |
# A simple script to automate the creation of a new blog post. | |
# An automator task will pick the file name in output and open | |
# it with the default editor. | |
# | |
require 'rubygems' | |
require 'active_support/all' | |
require 'pathname' |
This file contains hidden or 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
/* ----- SimpleForm Styles ----- */ | |
.simple_form | |
div.input | |
margin-bottom: 10px | |
clear: both | |
label | |
float: left | |
width: 100px |
This file contains hidden or 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
#!/usr/bin/env bash | |
# Copy this file into the home directory of the sudoer | |
# user that will run all chef recipes. | |
sudo apt-get -y update | |
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev | |
sudo apt-get -y install rsync | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz |
This file contains hidden or 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 PaperclipMongoidPatch | |
class << self | |
def obtain_class | |
class_name = ENV['CLASS'] || ENV['class'] | |
raise "Must specify CLASS" unless class_name | |
@klass = Object.const_get(class_name) | |
end | |
def obtain_attachments | |
name = ENV['ATTACHMENT'] || ENV['attachment'] |
This file contains hidden or 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
#!/bin/bash | |
# | |
# pre-commit hook, avoid committing :focus on rspec examples | |
focus=', :focus' | |
result=$(git grep -n $focus -- */**/*_spec.rb) | |
if [ "$result" != '' ]; then | |
echo "" | |
echo "Refusing to commit a :focus tag in specs: " | |
echo "" |
This file contains hidden or 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
# vim: ft=ruby | |
source :rubygems | |
gem 'eventmachine' | |
gem 'em-zeromq', :path => '~/Work/em-zeromq' | |
gem 'sinatra' | |
gem 'zmq' |