Skip to content

Instantly share code, notes, and snippets.

View kaiwren's full-sized avatar

Sidu Ponnappa kaiwren

View GitHub Profile
@kaiwren
kaiwren / bm_factorial.js
Last active August 29, 2015 14:16
Opal Microbenchmarks from github.com/kaiwren/redson
JS.Benchmarks.fact = function(n){
if(n > 1) {
return n * this.fact(n-1);
}
else {
return 1;
}
}
@kaiwren
kaiwren / nqueens.rb
Last active August 29, 2015 14:07
Answering a question asked on the Fb Learn Ruby Programming group
class Queen
def initialize(arrayLength)
@array = Array.new(arrayLength)
end
def starter
enumerate(@array,0)
end
@kaiwren
kaiwren / rbmonk-class-example.rb
Last active August 29, 2015 14:04
RubyMonk Example with output
class Rectangle
def initialize(length, breadth)
@length = length
@breadth = breadth
end
def perimeter
2 * (@length + @breadth)
end
Problem: Why should I get out of bed?
Answer: Because I need to work to support the people I care about. This includes your own time (to spend with them), food, housing, simple luxuries and top-notch healthcare. I personally need between two and five crores in today's money in the bank for this. (INR Five crores == USD ~1 million).
Problem: Ok, you've made that much money. Now why should you get out of bed?
Answer: Well, now it's just your own fulfillment. Boredom is the enemy. Why think small? Cure death. Produce unlimited energy.
Problem: But this takes resources.
@kaiwren
kaiwren / jasimsskillset.txt
Created March 19, 2012 13:55
Jasim's skillset
- DOS
- CA-Clipper
- dBase
- FoxPro
- Wordstar
- Wordperfect
- Dave
- Prince of Persia
- Adobe Pagemaker
@kaiwren
kaiwren / gist:1283905
Created October 13, 2011 10:13
Steve Yegge's SOA post
From: https://raw.github.com/gist/933cc4f7df97d553ed89/24386c6a79bb4b31fb818b70b34c5eab7f12e1ff/gistfile1.txt
Stevey's Google Platforms Rant
I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.
I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various effort
@kaiwren
kaiwren / json_bench.rb
Created September 15, 2011 11:15
Json gem vs. Json pure
require 'rubygems'
require 'multi_json'
require 'benchmark'
n = 100000
json = "{\"ids_shop\":[],\"ids_collection\":[],\"ids_wish_list\":[]}"
Benchmark.bmbm do |x|
# x.report("json") do
@kaiwren
kaiwren / gist:957742
Created May 5, 2011 19:41
Quote from the Buddha

From http://everything2.com/title/nontheist

The Buddha is the first historically known nontheist. Most Buddhists are nontheist.

The Buddha was often asked whether God existed. Usually, he replied with a complete silence. Once, however, he told the story of the man shot by a poisoned arrow.

When the doctor came and wanted to pull the arrow out of the wound, the man grabbed the doctor's hand and asked:

"Before you start treating me, Doctor, tell me, who was it that shot me? Was he of warrior class or some other class? Was he tall or was he short? Was he young or was he old? Was he dark skinned or light skinned?"

@kaiwren
kaiwren / build_speeds
Created April 24, 2011 23:39
Build times across rubies for pure ruby projects
~/Work/wrest (master)λ rake ruby-1.9.2-p180@wrest
(in /Users/sidu/Work/wrest)
Building on Ruby 1.9.2, 2011-02-18, x86_64-darwin10.6.0
<snip/>
Finished in 3.03 seconds
369 examples, 0 failures
------------------------
~/Work/wrest (master)λ rake ree-1.8.7-2011.03@wrest
(in /Users/sidu/Work/Rspec/rspec-core)
zsh:1: no matches found: bin/*
zsh:1: no matches found: bin/*
zsh:1: no matches found: bin/*
zsh:1: no matches found: bin/*
No examples were matched by {:focus=>true}, running all
...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................*.................................
Pending:
RSpec::Core::Formatters::BaseFormatter read_failed_line when String alias to_int to_i doesn't hang when file exists