Skip to content

Instantly share code, notes, and snippets.

View schisamo's full-sized avatar

Seth Chisamore schisamo

View GitHub Profile
@tmm1
tmm1 / iterator.rb
Created October 30, 2009 08:28
simple eventmachine async iterator
module EventMachine
# A simple iterator for concurrent asynchronous work.
#
# Unlike ruby's built-in iterators, the end of the current iteration cycle is signaled manually,
# instead of happening automatically after the yielded block finishes executing. For example:
#
# (0..10).each{ |num| }
#
# becomes:
#
# Make gems available
require 'rubygems'
# http://drnicutilities.rubyforge.org/map_by_method/
begin
require 'map_by_method'
rescue LoadError
puts "map_by_method is not installed. To enable, run: gem install map_by_method"
end
#!/bin/bash
# Run iTerm.app once, quit & run script from Terminal.app
MONOKAI='{
"Ansi 0 Color" = {
"Blue Component" = 0.0;
"Green Component" = 0.0;
"Red Component" = 0.0;
};
current_dir = File.dirname(__FILE__)
platform = "https://api.opscode.com/organizations"
require 'grit'
branch = Grit::Repo.new("#{current_dir}/..").head.name
case branch
when "internal"
url = "http://virt1test.int.example.org:4000"
validator = ""
#!/usr/bin/env ruby
require 'rubygems'
require 'chef'
require 'chef/client'
require 'chef/run_context'
Chef::Config[:solo] = true
Chef::Config[:log_level] = :info
Chef::Log.level(:info)
#!/usr/bin/env ruby
require 'rubygems'
require 'chef'
require 'chef/client'
require 'chef/run_context'
Chef::Config[:solo] = true
Chef::Config[:log_level] = :info
Chef::Log.level(:info)
require 'chef'
require 'chef/node'
class Opscode
class Backup
attr_accessor :backup_dir
def initialize(backup_dir, config_file)
@backup_dir = backup_dir
Chef::Config.from_file(config_file)
@jtimberman
jtimberman / macbook.md
Created November 12, 2010 14:48
How I set up my workstation

My current workstation toolchain environment was set up with the following, roughly in order.

  1. Latest Xcode from Apple to get development tools.

  2. Homebrew.

  3. A few nice things with Homebrew:

    brew install git ack wget tmux sloccount ec2-ami-tools ec2-api-tools rds-command-line-tools

@rcreasey
rcreasey / application_default.rb
Created November 16, 2010 04:35
application::default
include_recipe "git"
node.run_state[:applications] = []
search(:apps) do |app|
(app["server_roles"] & node.run_list.roles).each do |app_role|
node.run_state[:applications] << {:app => app, :recipes => app["type"][app_role]}
end
end