Skip to content

Instantly share code, notes, and snippets.

View closer's full-sized avatar
🎯
Focusing

closer closer

🎯
Focusing
View GitHub Profile
@jlecour
jlecour / post_to_slack.rb
Last active May 22, 2022 17:43
How to post alerts from Monit to Slack
# encoding: UTF-8
require 'optparse'
require 'net/http'
require 'json'
def parse_options(argv)
opts = {}
@parser = OptionParser.new do |o|
@sj26
sj26 / apple_record.rb
Created June 23, 2013 04:58
How I do STI: Utilize descendent tracking and override model_name so they use the same URL helpers and parameters as their base class. Makes things like responders and form_for work as expected, while preserving things like to_partial_path.
class AppleRecord < Record
end
@valvallow
valvallow / 4.txt
Last active December 15, 2015 04:59
FF5
             
                                                              
@aereal
aereal / config_application.rb
Last active December 12, 2015 09:19
Rails example to log session as LTSV (Labeled Tab-separated Values)
class Application < Rails::Application
config.middleware.use LtsvRequestLogger
end
@mxcl
mxcl / uninstall_homebrew.sh
Created August 26, 2011 11:25
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e