Skip to content

Instantly share code, notes, and snippets.

@JakubOboza
JakubOboza / gist:1996858
Created March 7, 2012 22:51
webmachine + earlydtl
httperf --server=127.0.0.1 --port=8000 --uri=/ --num-calls=20000 --num-conns=2
httperf --client=0/1 --server=127.0.0.1 --port=8000 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=2 --num-calls=20000
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE
Maximum connect burst length: 1
Total: connections 2 requests 40000 replies 40000 test-duration 18.102 s
Connection rate: 0.1 conn/s (9051.1 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 8247.4 avg 9051.1 max 9854.8 median 8247.5 stddev 1136.7
Connection time [ms]: connect 0.2
@JakubOboza
JakubOboza / gist:1992284
Created March 7, 2012 09:48
how long it takes to get time from redis 2.9
redis 127.0.0.1:6379> MULTI
OK
redis 127.0.0.1:6379> TIME
QUEUED
redis 127.0.0.1:6379> TIME
QUEUED
redis 127.0.0.1:6379> TIME
QUEUED
redis 127.0.0.1:6379> EXEC
1) 1) "1331113681"
// Google Maps Directions combinator
function googleMapsDirectionsCombinator(start, elementId){
var directionDisplay;
var directionsService = new google.maps.DirectionsService();
var map;
var start = start;
var elementId = elementId;
var elementIdWithHash = "#" + elementId;
require 'minitest/spec'
require 'minitest/autorun'
describe Array do
it "can be created with no arguments" do
Array.new.must_be_instance_of Array
end
it "can be created with a specific size" do
Array.new(10).size.must_equal 10
12:14 joboza@staging:~/Workspace/C/redis/src% cc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
--------------------
@JakubOboza
JakubOboza / gist:1884825
Created February 22, 2012 12:34
trollstack
12:13 joboza@staging:~/Workspace/C/redis% make
cd src && make all
CC ae.o
CC anet.o
CC redis-benchmark.o
CC sds.o
CC adlist.o
CC zmalloc.o
LINK redis-benchmark
CC redis-cli.o
@JakubOboza
JakubOboza / gist:1884766
Created February 22, 2012 12:30
files with sizes
ls -lh | awk '{ print $5 " \t -> " $9; }'
ActiveAdmin.register User do
index do
column :email
column :last_sign_in_at
column :sign_in_count
default_actions
end
form do |f|
21:10 kuba@Jakubs-MacBook-Pro:~/Workspace/Nodejs/webeval% NODE_ENV=test mocha -R landing lib/uidgenerator.coffee
--------------------------------------------------------------------------------------------------------------
⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅✈
--------------------------------------------------------------------------------------------------------------
✔ 2 tests complete (19ms)
crypto = require('crypto')
exec = require('child_process').exec
chomp = () ->
this.replace(/(\n|\r)+$/, '')
String.prototype.chomp = chomp
class UidGenerator