hide do
_ _ _
/\ /(_) __| | __| | ___ _ __
/ /_/ / |/ _` |/ _` |/ _ \ '_ \
/ __ /| | (_| | (_| | __/ | | |
\/ /_/ |_|\__,_|\__,_|\___|_| |_|
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
namespace :queues do | |
desc "Run Resque workers with options and job classes loaded" | |
# Run with & appended to daemonize | |
task :workers => :environment do | |
def pid_directory | |
Rails.root.join('tmp', 'pids') | |
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
# Abstract classes, const_get etc examples for a dev friend | |
class String | |
# http://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/string/inflections.rb#L44-49 | |
def camelize | |
self.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase } | |
end | |
end | |
module MyParsers |
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
# Sketch of a Ruby API for ElasticSearch [http://elasticsearch.com] | |
require 'rubygems' | |
require 'curb' | |
require 'rest_client' | |
require 'yajl/json_gem' | |
module Slingshot | |
def http |
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
# = Collection | |
# | |
# Module which allows to use a proxy class for wrapping collections of all sorts. | |
# | |
# Let's take a collection of articles, for example (see also the test suite below). | |
# | |
# The collection item class could look like this: | |
# | |
# class Article | |
# attr_reader :title |
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
.vagrant | |
Gemfile.lock | |
Berksfile.lock | |
tmp/ |
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
license: gpl-3.0 |
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
#!/usr/bin/env ruby | |
# Example script to deploy a Rails application via Git post-receive hook | |
# | |
# INSTALL | |
# | |
# $ curl http://gist.github.com/442106.txt -o post-receive | |
# $ mv post-receive path/to/to/your/repo.git/hooks/post-receive | |
# $ chmod +x post-receive |
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
# ===================================================== | |
# Installation instructions for a clean Mac OS X system | |
# ===================================================== | |
# | |
# <https://gist.github.com/747336> | |
# | |
# Keep only `.ssh` and `.profile.local` files from backup | |
# + Clean up Apple Ruby |
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
#!/usr/bin/env sh | |
# I've adapted this from the following, which was in turn adapted from the link | |
# below it: | |
# * https://raw.github.com/gist/2108403/hack.sh | |
# * https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
echo "Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)" | |
# defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 |
OlderNewer