Skip to content

Instantly share code, notes, and snippets.

View cmer's full-sized avatar

Carl Mercier cmer

  • Toronto, ON, Canada
View GitHub Profile
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
@cmer
cmer / gist:1267518
Created October 6, 2011 14:25
EBS RAID0 (4 volumes) vs /mnt on m1.large
EBS RAID
-------------------
Version 1.96 ------Sequential Output------ --Sequential Input- --Random-
Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
ip-10-124-33-11 15G 303 97 64239 9 61263 12 510 99 214939 22 1180 43
Latency 79123us 1144ms 844ms 73559us 214ms 223ms
Version 1.96 ------Sequential Create------ --------Random Create--------
ip-10-124-33-116 -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
@cmer
cmer / gist:1355634
Created November 10, 2011 18:18
Beanstalk-Client segfault
/usr/local/rvm/gems/ruby-1.9.2-p180/gems/beanstalk-client-1.1.0/lib/beanstalk-client/connection.rb:194: [BUG] Segmentation fault
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]
-- control frame ----------
c:0027 p:---- s:0111 b:0111 l:000110 d:000110 CFUNC :gets
c:0026 p:0015 s:0107 b:0107 l:000106 d:000106 METHOD /usr/local/rvm/gems/ruby-1.9.2-p180/gems/beanstalk-client-1.1.0/lib/beanstalk-client/connection.rb:194
c:0025 p:0011 s:0103 b:0103 l:000102 d:000102 METHOD /usr/local/rvm/gems/ruby-1.9.2-p180/gems/beanstalk-client-1.1.0/lib/beanstalk-client/connection.rb:200
c:0024 p:0013 s:0096 b:0096 l:000095 d:000095 METHOD /usr/local/rvm/gems/ruby-1.9.2-p180/gems/beanstalk-client-1.1.0/lib/beanstalk-client/connection.rb:215
c:0023 p:0169 s:0089 b:0087 l:000086 d:000086 METHOD /usr/local/rvm/gems/ruby-1.9.2-p180/gems/beanstalk-client-1.1.0/lib/beanstalk-client/connection.rb:100
c:0022 p:0026 s:0083 b:0083 l:000082 d:000082 METHOD /usr/local/rvm/gems/ruby-1.9.2-p180/gems/beanstalk-client-1.1.0/lib/beanst
@cmer
cmer / gist:1355664
Created November 10, 2011 18:25
net/http segfault
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/http.rb:644: [BUG] Segmentation fault
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]
-- control frame ----------
c:0049 p:---- s:0258 b:0258 l:000257 d:000257 CFUNC :initialize
c:0048 p:---- s:0256 b:0256 l:000255 d:000255 CFUNC :open
c:0047 p:0029 s:0251 b:0251 l:0018d0 d:000250 BLOCK /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/http.rb:644
c:0046 p:0031 s:0249 b:0249 l:000248 d:000248 METHOD /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/timeout.rb:44
c:0045 p:0026 s:0237 b:0237 l:000236 d:000236 METHOD /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/timeout.rb:87
c:0044 p:0038 s:0231 b:0231 l:0018d0 d:0018d0 METHOD /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/http.rb:644
##
## TAKEN FROM https://raw.github.com/benhoskings/delayed_job/c3a28f9714568c887271e492dd8c6710965278e8/lib/delayed/yaml_ext.rb
## Solves problems serializing strategies to yaml
##
# These extensions allow properly serializing and autoloading of
# Classes, Modules and Structs
require 'yaml'
class Module
@cmer
cmer / hash.rb
Created December 19, 2011 03:16
Hash#value_at_path
class Hash
# Returns the value at the specified path.
# For example, [:foo, :bar, :baz] as a path would return the
# value at self[:foo][:bar][:baz]. If self doesn't contain one of
# the keys specified in path, nil is returned.
#
# This method is useful as it simplifies statements such as:
# value = h[:a][:b][:c][:d] if h[:a] && h[:a][:b] && h[:a][:b][:c]
# to
# value = h.value_at_path(:a, :b, :c, :d)
class Feed
fetch: ->
url = "http://example.org/feed?x=1"
url += "&ts=#{@oldest_item}" if @oldest_item
$.getJSON url, (data) ->
@oldest_item = data.oldest_item
# do something else with data
# How can I set a class variable from an anonymous function? For example, @oldest_item on line 4 is always null.
@cmer
cmer / gist:1566734
Created January 5, 2012 19:16
UnixBench comparison of EC2 and Joe's Data Center
apt-get install -y build-essential libx11-dev libgl1-mesa-dev libxext-dev perl perl-modules make
cd /tmp
wget http://byte-unixbench.googlecode.com/files/UnixBench5.1.3.tgz
tar xzvf UnixBench5.1.3.tgz
cd UnixBench
./Run
@cmer
cmer / gist:1724957
Created February 2, 2012 18:20
Hetzner EX 4S UnixBench
# # # # # # # ##### ###### # # #### # #
# # ## # # # # # # # ## # # # # #
# # # # # # ## ##### ##### # # # # ######
# # # # # # ## # # # # # # # # #
# # # ## # # # # # # # ## # # # #
#### # # # # # ##### ###### # # #### # #
Version 5.1.3 Based on the Byte Magazine Unix Benchmark
Multi-CPU version Version 5 revisions by Ian Smith,
class @GroupActionMenuHandler
bind: ->
$(document).on 'click', '.group-action-menu a', (e) =>
# The following line triggers error: GroupActionMenuHandler.selectMenuItem is not a function
this.selectMenuItem $(e.target).data('id')
false
selectMenuItem: (selectedItem) ->
alert 'hello'