Skip to content

Instantly share code, notes, and snippets.

# Package Maintainer: Increment phusion_release to match latest release available
%define phusion_release 2011.03
Summary: Ruby Enterprise Edition (Release %{phusion_release})
Name: ruby-enterprise
Vendor: Phusion.nl <info@phusion.nl>
Packager: Adam Vollrath <hosting@endpoint.com>
Version: 1.8.7
Release: 8%{dist}
License: Ruby or GPL v2
@mhat
mhat / a-guide.markdown
Created August 15, 2010 23:11
rolling with homebrew

Rolling with HomeBrew (rather than MacPorts)

First things first, we have to install HomeBrew. Once installed we can do pretty much everything else via HomeBrew. By default HomeBrew will install to /usr/local. It's possible to choose a different directory but everything I've read so far says it's a PITA. I'm sticking with the default.

ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"

Getting your development environment running requires a few servers. You could get by with as little as Postgres and Memcached but it'll be better if you have Nginx and RabbitMQ as well. Eventually you'll probably want Redis and Artie as well.

TODO: instructions for Redis and Artie

@mnutt
mnutt / Instrument Anything in Rails 3.md
Created September 6, 2010 06:50
How to use Rails 3.0's new notification system to inject custom log events

Instrument Anything in Rails 3

With Rails 3.0 released a few weeks ago I've migrated a few apps and I'm constantly finding useful new improvements. One such improvement is the ability to log anything in the same way that Rails internally logs ActiveRecord and ActionView. By default Rails 3 logs look slightly spiffier than those produced by Rails 2.3: (notice the second line has been cleaned up)

Started GET "/" for 127.0.0.1 at Mon Sep 06 01:07:11 -0400 2010
  Processing by HomeController#index as HTML
  User Load (0.2ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1
  CACHE (0.0ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1

Rendered layouts/_nav.html.erb (363.4ms)

@tmm1
tmm1 / gist:648512
Created October 27, 2010 05:37
http proxymachine api brainstorm
# load balancing
# send incoming requests to one of 10 backends running on ports 5000-5009
HttpProxyMachine.start do
{ :host => 'localhost', :port => 5000 + rand(10) }
end
# host based routing
# send requests for media.server/file to localhost:3000/media/file
# all other requests are unmodified
HttpProxyMachine.start do |request|
@WaYdotNET
WaYdotNET / align.el
Created November 15, 2010 14:40
Align function emacs
;; Align command !!!
;; from http://stackoverflow.com/questions/3633120/emacs-hotkey-to-align-equal-signs
;; another information: https://gist.github.com/700416
;; use rx function http://www.emacswiki.org/emacs/rx
(defun align-to-colon (begin end)
"Align region to colon (:) signs"
(interactive "r")
@jeffmccune
jeffmccune / irc_notify_loop.rb
Created November 20, 2010 20:25
IRC Boxcar + Jabber notification
#!/usr/bin/env ruby
#
# This script reads lines from STDIN and sends a notification for each line.
# It's intended to be used with the fnotify.pl IRSSI script to write notices
# and hilights to a plain text file. tail -f links the two systems together.
require 'rubygems'
# For Jabber Notification
gem 'xmpp4r-simple'
@plathrop
plathrop / puppet-validate.el
Created July 29, 2011 16:48
Minor mode for validating puppet manifests.
;;; -*- coding: utf-8 -*-
;;;
;;; puppet-validate.el --- minor mode for validating puppet manifest
;;; syntax.
;;;
;;; © 2011 Paul Lathrop <paul@tertiusfamily.net>
;;;
;;; Keywords: languages puppet
;;;
;;; puppet-validate.el is free software; you can redistribute it and/or modify it
@redsweater
redsweater / SwitchProfile
Created October 12, 2011 15:35
If you use ScanSnap, you can have GUI Scripting automate the process of switching among your scan profiles ...
-- Launches ScanSnap Manager, if necessary. Opens the ScanSnap Manager settings window,
-- changes to named profile, applies changes, and closes the window
-- Example:
SwitchToProfile("Standard")
on SaveActiveApplication()
return application
end SaveActiveApplication
on OpenOptionsWindow()
def output name=((default=true); "caius")
puts "name: #{name.inspect}"
puts "default: #{default.inspect}"
end
output
# >> name: "caius"
# >> default: true
output "avdi"
#! /bin/zsh
usage () {
echo "usage: ${0:t} [-f known_hosts] host..."
}
KNOWN_HOSTS="$HOME/.ssh/known_hosts"
expanded_hosts() {
case $(uname) in