Skip to content

Instantly share code, notes, and snippets.

View tmm1's full-sized avatar

Aman Gupta Karmani tmm1

View GitHub Profile
@adelcambre
adelcambre / 00_tokyo.md
Last active August 29, 2015 14:06
Surviving tokyo

Some basics on Tokyo

Your phone should work

Just like in Europe. It's the same normal international data plan for most carriers (I've done it on At&t and Verizon).

Cash is king

And you get cash from 7-11 (yes I'm serious). American cards very very frequently don't work. Especially in any sort of machine, particularly vending machines and the train ticket machines. Many atm's won't take american cards either. But, every single 7-11 (which are everywhere) has an atm which takes american cards. They sometimes say 7-i, or Seven and i holdings. It's all the same thing (7-11 is actually a japanese company, and they are everywhere). Other than 7-11, every Post office should have an ATM that works too, but they are way less common.

~/projects/jruby ➔ jruby -J-Xrunjdwp:transport=dt_socket,server=y,address=12345,suspend=n object_walker_test.rb
Listening for transport dt_socket at address: 12345
found object: I am Foo #0
found object: I am Foo #1
found object: I am Foo #2
found object: I am Foo #3
found object: I am Foo #4
found object: I am Foo #5
found object: I am Foo #6
found object: I am Foo #7
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;
@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
// Copyright 2009 Ryan Dahl <ry@tinyclouds.org>
#include <node_events.h>
#include <node.h>
namespace node {
using namespace v8;
// EventSource

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,

# 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
@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'
@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>
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)