Skip to content

Instantly share code, notes, and snippets.

View cmer's full-sized avatar

Carl Mercier cmer

  • Toronto, ON, Canada
View GitHub Profile
# COWBOY CODING FTW! TESTING IS FOR WUSSIES. ;-)
require File.dirname(__FILE__) + '/test_helper'
class CowboyTest < Test::Unit::TestCase
def test_my_awesomeness
(0..12612).each {
assert :this_code_does_not_contain_bugs
}
end
#!/bin/bash
#================================================================================
# /engineyard/bin/monit_merb_mpc
#================================================================================
# This script controls the multi-process Merb 1.0 service
#
# Do not forget to ensure this script is executable:
# $ chmod a+x /engineyard/bin/monit_merb_mpc
#================================================================================
#!/bin/bash
#================================================================================
# /engineyard/bin/monit_merb_mpc
#================================================================================
# This script controls the multi-process Merb 1.0 service
#
# Do not forget to ensure this script is executable:
# $ chmod a+x /engineyard/bin/monit_merb_mpc
#================================================================================
# taken from http://eigenclass.org/hiki.rb?ruby+live+process+introspection
###################
# #### RUBY STUFF
define eval
call(rb_p(rb_eval_string_protect($arg0,(int*)0)))
end
define redirect_stdout
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
0/1 10.8.0.5 UGSc 3 0 tun0
default 192.168.1.1 UGSc 10 0 en1
10.8.0.1/32 10.8.0.5 UGSc 0 0 tun0
10.8.0.5 10.8.0.6 UH 9 0 tun0
10.37.129/24 link#8 UC 3 0 vnic1
10.37.129.2 0:1c:42:0:0:9 UHLWI 2 7 lo0
( [4689]11 | *xxS0 | <:1>[2-9]xx[2-9]xxxxxxS0 | 1[2-9]xx[2-9]xxxxxxS0 | 011xxxxxxx. | [#*x][#*x][#*x][#*x]. )
@cmer
cmer / yaml_benchmark.rb
Created November 19, 2010 23:05
YAML, ZAML, Marshal & JSON quick'n'dirty benchmark.rb
require 'rubygems'
require 'benchmark'
require 'yaml'
require 'zaml'
require 'json'
yaml_str = <<-eos
yaml goes here
eos
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
--------------------------------------------------------------------
YAML.load: 0.7924
Marshal.load: 0.0742
to_yaml: 5.1661
ZAML.dump: 1.4574
to_json: 0.1152
Marshal.dump: 0.0845
ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.4.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02
# Fixes broken UTF8 strings as instructed at http://ruby.runpaint.org/encoding
def self.sanitize_string(str, request_charset=nil)
return str unless str.is_a?(String)
ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')
dest = ic.iconv(str + ' ')[0..-2]
dest = encode_from_request_charset(str, request_charset) unless dest.valid_encoding?
dest
end
Dear Customer,
Thank you for your interest in the HP TouchPad and webOS. The overwhelming demand for this product in recent days has made it difficult to fulfill your request at the present time, and we are working to make more available as soon as possible. While we do not yet have specific details, we know it will be at least a few weeks before we have a limited quantity available again. We will keep you informed as we have more specifics that we can communicate, and we encourage you to join the conversation here for the latest information.
In light of this and other recent HP news, we want you to know that we remain committed to you. We will continue to honor our warranties now and in the future. We will continue delivering products that make a difference in your life and we will continue to provide the best possible service to you every day.
We are grateful for your patience and loyalty and to show our gratitude, we are offering you an exclusive one-time opportunity to save an additional amount on