Skip to content

Instantly share code, notes, and snippets.

View kapso's full-sized avatar

Kapil kapso

View GitHub Profile
@kapso
kapso / .json
Created November 10, 2015 09:28
{
"depots": [
{
"id": 4,
"street": "800 W. Huron St., Suite 100",
"city": "Chicago",
"state": "IL",
"postal_code": "60642",
"postal_codes": [
"60614",
@kapso
kapso / .json
Created November 10, 2015 09:28
{
"depots": [
{
"id": 4,
"street": "800 W. Huron St., Suite 100",
"city": "Chicago",
"state": "IL",
"postal_code": "60642",
"postal_codes": [
"60614",
@kapso
kapso / gist:7382254
Created November 9, 2013 05:56
Draper vs Active Model Serializer vs jbuilder
########### Draper ###########
19:33 ~ $ ab -n 2000 http://localhost:3000/cities?test=d
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 200 requests
@kapso
kapso / gist:6678961
Last active December 23, 2015 18:58
# of Visits: 104, at: [36.10759979498738, -115.18277133146694]
# of Visits: 6, at: [36.105838005246014, -115.18051368412809]
# of Visits: 1, at: [36.113454, -115.183351]
# of Visits: 1, at: [36.114811, -115.192587]
# of Visits: 4, at: [36.11505675002736, -115.2079057505923]
# of Visits: 1, at: [36.114552, -115.237915]
# of Visits: 1, at: [36.114587, -115.240332]
# of Visits: 1, at: [36.114484, -115.229239]
# of Visits: 2, at: [36.101962, -115.20592099999999]
# of Visits: 4, at: [36.10009274992063, -115.22499650291948]
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#
@kapso
kapso / gist:5201706
Last active December 15, 2015 04:29
Kapil,Israni,78
Steve,Jobs,22
rwrwe
def thread_write
pool = ThreadPool.new(80)
doc_size = 10000
doc_size.times do |i|
pool.process do
write_doc(i)
read_doc(i)
end
def thread_write
pool = ThreadPool.new(80)
doc_size = 10000
doc_size.times do |i|
pool.process do
write_doc(i)
read_doc(i)
end
def thread_write
pool = ThreadPool.new(80)
doc_size = 10000
doc_size.times do |i|
pool.process do
write_doc(i)
read_doc(i)
end