Public Gists by chuyeow

gist: 226858 Good for checking number of...
Gravatar
Wed Nov 04 23:42:02 -0800 2009
1
2
3
jQuery.fn.bind = function (bind) {
  return function () {
    console.count("jQuery bind count");
Gravatar
Mon Aug 31 22:07:07 -0700 2009
1
2
3
var = :foo
%w(a b c).each do |var|
  # Do something.
Gravatar
Sun Jul 26 02:32:18 -0700 2009
1
2
3
static NSString *CellIdentifier = @"Cell";
cell = (MyCustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
Gravatar
Wed Jul 08 21:44:26 -0700 2009
1
./scan-build -k -V -o foo/ xcodebuild -configuration Debug -sdk iphonesimulator3.0
Gravatar
Thu Jul 02 00:15:40 -0700 2009
1
2
3
@namespace url(http://www.w3.org/1999/xhtml);
 
@-moz-document domain("friendfeed.com") {
Gravatar
Wed Jun 03 03:34:18 -0700 2009
1
2
3
// Clear newsletter textbox on focus if it contains the default text.
$('#newsletter_email').focus(function() {
 
Gravatar
Wed May 13 00:50:24 -0700 2009
1
2
3
builder = Nokogiri::XML::Builder.new do |xml|
  xml.listings {
    xml.language 'en'
Gravatar
Mon Mar 16 02:18:17 -0700 2009
1
2
3
function foo() {
  if (!arguments.callee.done) {
    arguments.callee.done = true;
Gravatar
Tue Mar 03 19:37:57 -0800 2009
1
2
3
// Show popup when user hovers over a child element of a container div.
$('div.child', '#container').mouseover(function() {
  $('#popup').show();
gist: 34577 Micro-benchmark for new Ord...
Gravatar
Wed Dec 10 18:23:32 -0800 2008
1
2
3
# Micro-benchmark for new OrderedHash impl in http://github.com/rails/rails/commit/355f41d8aafd75d76db25cdda4736e0052b0605c
class OrderedHash < Hash
  def initialize(*args, &block)
gist: 30614 Is JSON.parse! faster?
Gravatar
Sun Nov 30 20:08:36 -0800 2008
1
2
3
      user system total real
json:parse 0.100000 0.010000 0.110000 ( 0.106557)
json:parse! 0.110000 0.000000 0.110000 ( 0.129599)
Gravatar
Tue Oct 21 20:43:58 -0700 2008
1
2
3
$ ./hpricot_vs_nokogiri.rb
      user system total real
hpricot:doc 0.230000 0.010000 0.240000 ( 0.265904)