A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
#!/usr/bin/env ruby | |
# twail.rb | |
# Twitter stream tail | |
# Copyright 2010 Jonathan Rudenberg | |
# Licensed under the MIT License | |
# | |
# Prerequisites: gem install json twitter-stream | |
require 'optparse' |
/** | |
* REST interface to Akka's JMX service. | |
* <p/> | |
* Here is an example that retreives the current number of Actors. | |
* <pre> | |
* http://localhost:9998/management | |
* ?service=service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi | |
* &component=se.scalablesolutions.akka:type=Stats | |
* &attribute=counter_NrOfActors | |
* </pre> |
module SQLGrowler | |
class Subscriber < ActiveRecord::Railties::Subscriber | |
def sql(event) | |
super | |
g('%s (%.1fms) %s' % [event.payload[:name], event.duration, event.payload[:sql].squeeze(' ')]) | |
end | |
end | |
def self.enable | |
if Kernel.respond_to?(:g) |
# List what ports are in use on OS X | |
sudo lsof -iTCP -sTCP:LISTEN -P |
# Mimic Mac OS X Finder's sort by name. | |
class Array | |
def finder_sort | |
sort { |a, b| a.to_finder_sort <=> b.to_finder_sort } | |
end | |
end | |
class String | |
def to_finder_sort | |
result = self.dup |