Skip to content

Instantly share code, notes, and snippets.

View Byte Formatting for Google Sheets.md
View octopress_theme_scraper.rb
require 'nokogiri'
require 'octokit'
require 'open-uri'
github = Octokit::Client.new(:access_token => ENV['GH_TOKEN'])
doc = Nokogiri::HTML.fragment(open('https://github.com/imathis/octopress/wiki/3rd-Party-Octopress-Themes').read)
doc.search('table tr td:first a:first').map do |a|
a['href'] =~ %r{https?://github.com/([^/]+)/([^?/]+)(\?|$|/)} && [$1, $2]
View site.pp
node default {
# This is required to apply some manifests since these are not using
# appropriate user, group or full path to the command.
Exec {
group => "staff",
user => $boxen_user,
path => [
"/usr/local/bin",
"/usr/bin",
"/bin",
View improved_controller_logging.rb
#
# Ideas stolen from lograge and brought to Rails 2.3
# https://github.com/mattmatt/lograge/blob/master/lib/lograge/log_subscriber.rb
#
module ImprovedControllerLogging
def self.included(base)
base.alias_method_chain :log_processing, :fixup
base.inject_alias_method_chain :perform_action,
:perform_action_with_benchmark,
View the_install.sh
#!/usr/bin/env sh
# Title: Ruby development environment for OS X (Lion)
# Author: Rogelio J. Samour
# Warning:
# While it is unlikely any code below might damage your system,
# it’s always a good idea to back up everything that matters to you
# before running this script! Just in case. I am not responsible for
# anything that may result from running this script. Proceed at
# your own risk.
@a-warner
a-warner / ant.sh
Created Feb 24, 2012
Is it your month to drink for free at Ant?
View ant.sh
#!/bin/sh
if [ ! $# -gt 0 ]; then echo "Usage: $0 <Name>"; exit 1; fi
curl "http://antarcticabar.com/NameNight.html" 2> /dev/null | grep -oi "$1" | wc -l | awk '{ if ($1 > 0) { print "Your month" } else {print "Nope"} }'
You can’t perform that action at this time.