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
def pbcopy(str) | |
IO.popen('pbcopy', 'r+') {|io| io.puts str } | |
output.puts "-- Copy to clipboard --\n#{str}" | |
end | |
Pry.config.commands.command "hiscopy", "History copy to clipboard" do |n| | |
pbcopy _pry_.input_array[n ? n.to_i : -1] | |
end | |
Pry.config.commands.command "copy", "Copy to clipboard" do |str| |
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
=begin | |
Capistrano deployment email notifier for Rails 3 | |
Do you need to send email notifications after application deployments? | |
Christopher Sexton developed a Simple Capistrano email notifier for rails. You can find details at http://www.codeography.com/2010/03/24/simple-capistrano-email-notifier-for-rails.html. | |
Here is Rails 3 port of the notifier. | |
The notifier sends an email after application deployment has been completed. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
require 'socket' | |
# This script runs every minute, captures stats about redis | |
# and forwards them to graphite as counter values. | |
# Graphite/carbon settings | |
GRAPHITE_HOST="graphite.intra.local.ch" | |
GRAPHITE_PORT=8125 |
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
# a Rack middleware component that enables ActiveRecord query caching | |
# To use, put "use QueryCaching" in your Sinatra app. | |
class QueryCaching | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
if is_static_file?(env) |
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 | |
require "rubygems" | |
require "json" | |
if ARGV.size < 1 | |
puts "Please provide a JSON file" | |
exit 1 | |
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
simple.rb | |
========= | |
require 'sinatra' | |
use Rack::CommonLogger | |
get '/' do | |
'hello' | |
end |
NewerOlder