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
Gem::Specification.new do |s| | |
s.name = 'bang' | |
s.version = '0.1.0' | |
s.platform = Gem::Platform::RUBY | |
s.author = 'Jeff Kreeftmeijer' | |
s.email = 'jeff@kreeftmeijer.nl' | |
s.summary = 'Bang!' | |
s.description = 'Bangs existing model methods' | |
s.files = ['bang.rb'] |
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
source :rubygems | |
# We are not loading Active Record, nor Active Resources etc. | |
# We can do this in any app by simply replacing the rails gem | |
# by the parts we want to use. | |
gem "actionpack", "~> 3.2" | |
gem "railties", "~> 3.2" | |
gem "tzinfo" | |
# Let's use thin |
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
#!/bin/bash | |
# | |
# PS1 magic | |
# | |
# Mostly copied from YUVAL KOGMAN version, added my own __git_ps1 stuff | |
# Original: http://gist.github.com/621452 | |
# | |
# See video demo of this at http://vimeo.com/15789794 | |
# | |
# To enable save as .bash_prompt in $HOME and add to .bashrc: |
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 'rubygems' | |
require 'rack' | |
class Object | |
def webapp | |
class << self | |
define_method :call do |env| | |
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?) | |
[200, {}, send(func, *attrs)] | |
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
#!/usr/bin/ruby | |
# | |
# I deliberately didn't DRY /usr/local references into a variable as this | |
# script will not "just work" if you change the destination directory. However | |
# please feel free to fork it and make that possible. | |
# | |
# If you do fork ensure you add a comment here that explains what the changes | |
# are intended to do and how well you tested them. | |
# |