Skip to content

Instantly share code, notes, and snippets.

------------------------------------------------------------------------
r619 | jcastagna | 2009-12-11 11:26:11 -0800 (Fri, 11 Dec 2009) | 2 lines
Changed paths:
M lib/settler/dependency.rb
M lib/settler/yum.rb
M lib/sunshine.rb
M lib/sunshine/app.rb
M lib/sunshine/console.rb
M lib/sunshine/deploy_server.rb
M lib/sunshine/deploy_server_dispatcher.rb
every 3.hours do
runner "MyModel.some_process"
rake "my:rake:task"
command "/usr/bin/my_great_command"
end
every 1.day, :at => '4:30 am' do
runner "MyModel.task_to_run_at_four_thirty_in_the_morning"
end
col 1 2 3 4 5 6
n=1: 2 2
n=2: 2 4 6
n=3: 2 6 12 20
n=4: 2 8 20 40 70
n=5: 2 10 30 70 140 252
@jcasts
jcasts / http_benchmark.rb
Created September 26, 2011 17:38
Simple synchronous benchmarking of em-http-request net/http and httpclient
require 'rubygems'
require 'net/http'
require 'httpclient'
require 'eventmachine'
require 'em-http'
num = ARGV[0] || 1000
url = "http://localhost:8080"
uri = URI.parse url
@jcasts
jcasts / gist:1243386
Created September 26, 2011 20:54
cmd line util for benchmarking
#!/usr/bin/env ruby
require 'rubygems'
require 'net/http'
require 'httpclient'
require 'eventmachine'
require 'em-http'
require 'optparse'
options = {}
#!/bin/bash
# bin/git-hlog
tags=( )
args=( )
tags_done=0
for arg in $@; do
if [ ${arg:0:1} = "-" ]; then
tags_done=1
#!/bin/bash
# bin/git-hlog
tags=( )
args=( )
tags_done=0
for arg in $@; do
if [ ${arg:0:1} = "-" ]; then
tags_done=1
@jcasts
jcasts / gist:2244392
Created March 29, 2012 22:29
Easy JSON command line parser
#! /bin/bash
# Prerequisite:
# $ gem install kronk
# Usage:
# json '{"foo": "bar"}'
# json example.com/foo.json
# echo '{"foo": "bar"}' | json
# See http://github.com/yaksnrainbows/kronk for more options
args=( "$@" )
class Base64IO
def initialize io
@io = io
@buff = ""
@eof = false
end
def eof?
# Before loading
> ObjectSpace.count_objects
=> {:TOTAL=>311504, :FREE=>243794, :T_OBJECT=>4097, :T_CLASS=>859, :T_MODULE=>31, :T_FLOAT=>7, :T_STRING=>50824, :T_REGEXP=>196, :T_ARRAY=>7564, :T_HASH=>164, :T_STRUCT=>1, :T_BIGNUM=>3, :T_FILE=>10, :T_DATA=>1460, :T_MATCH=>119, :T_COMPLEX=>1, :T_NODE=>2339, :T_ICLASS=>35}
# Loading just activesupport
> ObjectSpace.count_objects
=> {:TOTAL=>311504, :FREE=>235593, :T_OBJECT=>4101, :T_CLASS=>1183, :T_MODULE=>166, :T_FLOAT=>30, :T_STRING=>45899, :T_REGEXP=>426, :T_ARRAY=>10890, :T_HASH=>253, :T_STRUCT=>32, :T_BIGNUM=>6, :T_FILE=>29, :T_DATA=>3595, :T_MATCH=>49, :T_COMPLEX=>1, :T_RATIONAL=>1, :T_NODE=>9114, :T_ICLASS=>136}
# Loading just action_pack
> ObjectSpace.count_objects