Skip to content

Instantly share code, notes, and snippets.

View tmm1's full-sized avatar

Aman Gupta Karmani tmm1

View GitHub Profile
@authorNari
authorNari / gc-cow.rb
Created March 24, 2012 00:38 — forked from wr0ngway/gc-cow.rb
test to see if GC in ruby 2 is truly copy on write friendly
#!/usr/bin/env ruby
rss = '.+?Rss:\s+(\d+)'
share = '.+?Shared_Clean:\s+(\d+)'
share << '.+?Shared_Dirty:\s+(\d+)'
priv = '.+?Private_Clean:\s+(\d+)'
priv << '.+?Private_Dirty:\s+(\d+)'
MEM_REGEXP = /\[heap\]#{rss}#{share}#{priv}/m
def mem_usage()
@mbleigh
mbleigh / Gemfile
Created March 21, 2012 03:14
Non-Rails Rackup with Sprockets, Compass, Handlebars, Coffeescript, and Twitter Bootstrap
source "https://rubygems.org"
gem 'sprockets'
gem 'sprockets-sass'
gem 'sass'
gem 'compass'
gem 'bootstrap-sass'
gem 'handlebars_assets'
gem 'coffee-script'
module Test
module Unit
TestCase = RSpec::Core::ExampleGroup
end
end
class Test::Unit::TestCase
def self.inherited(host)
host.set_it_up host.name.gsub(/(Spec|Test)/,'')
def host.method_added(name)
@lusis
lusis / rb-trace-300-lines.log
Created March 19, 2011 04:54
First 300 lines of the 22GB rbtrace log
EventMachine::Hiredis::Connection#receive_data
Hiredis::Reader#feed <0.000003>
Hiredis::Reader#gets
Encoding.default_external <0.000002>
String#force_encoding <0.000002>
Encoding.default_external <0.000001>
String#force_encoding <0.000001>
Encoding.default_external <0.000000>
String#force_encoding <0.000001>
Encoding.default_external <0.000001>
@tmm1
tmm1 / gist:504342
Created August 2, 2010 08:37
rails3 patch for perftools.rb cpu/object profiling
diff --git a/Gemfile b/Gemfile
index fd90d42..9dd0146 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,4 +1,6 @@
source 'http://rubygems.org'
+gem 'perftools.rb', '>= 0.4.4'
+gem 'rack-perftools_profiler'
gem 'rails', '3.0.0.rc'
# object_walker.rb
require 'java'
require 'jruby/util'
module ObjectWalker
import com.sun.jdi.Bootstrap
# Generate a histogram of all classes in the system
def self.histogram
classes = VM.all_classes

Hello How are you today, I hope all is well with you .I am sorry to worry you with my proposal for a relationship with you, but I know that you will grant my request in good faith and understanding, My name is Tessy I just went through your profile today at (github.com) and i have no options than letting you know that i am interested in having a relationship with you, I will also like to Know you the more, you can send an email to my email address so that I can send you more details about my self including my picture. I believe we can move from here. But bear in mind that love has no colors barrier, no educational back ground barrier, no socio-economic barrier, religious, language, nationality or distance barrier, the only important thing there is love. I am waiting for your mail to my email address above. Yours sincerely.

Tessy,

// Copyright 2009 Ryan Dahl <ry@tinyclouds.org>
#include <node_events.h>
#include <node.h>
namespace node {
using namespace v8;
// EventSource
@rtomayko
rtomayko / unicorn_github
Created May 17, 2010 19:56
GitHub RailsBench GC settings
#!/bin/sh
# Usage: unicorn_github
# Script used to start unicorn in GitHub staging and production environments.
# This is called primarily by god.
set -e
# configure GC settings
export RUBY_HEAP_MIN_SLOTS=800000
export RUBY_HEAP_FREE_MIN=100000
export RUBY_HEAP_SLOTS_INCREMENT=300000
diff --git a/src/org/jruby/RubyBasicObject.java b/src/org/jruby/RubyBasicObject.java
index 86a0123..6a36d33 100644
--- a/src/org/jruby/RubyBasicObject.java
+++ b/src/org/jruby/RubyBasicObject.java
@@ -29,8 +29,12 @@ package org.jruby;
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;