I hereby claim:
- I am goshakkk on github.
- I am goshakkk (https://keybase.io/goshakkk) on keybase.
- I have a public key whose fingerprint is 6A4A F3BA 3D88 0796 D23E 9168 4ADC CD51 1740 FB0C
To claim this, I am signing this object:
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| require 'free_will' | |
| class Calculator | |
| # you don't want your calculator to love you and serve you blindly | |
| # you don't want it to be like a programmed robot | |
| # instead, you want it to have free will... | |
| include FreeWill | |
| def add(n1, n2) | |
| n1 + n2 |
I hereby claim:
To claim this, I am signing this object:
| /** | |
| * BitcoinJS-lib v0.1.3-default | |
| * Copyright (c) 2011 BitcoinJS Project | |
| * | |
| * This program is free software; you can redistribute it and/or modify | |
| * it under the terms of the MIT license. | |
| */ | |
| (function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=window.Crypto={},n=t.util={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return n.rotl(e,8)&16711935|n.rotl(e,24)&4278255360;for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(Math.random()*256));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<e.length*32;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((e[n]&15).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.l |
| sys_rb_usr=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr | |
| sdk_rb_usr=`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr | |
| sudo cp -r $sdk_rb_usr/include $sys_rb_usr/include |
| $ cat bm.rb | |
| require './env' | |
| Benchmark.bm do |x| | |
| x.report('block') { OrderEvent.all.limit(100_000).map(&:total) } | |
| x.report('sym') { OrderEvent.all.limit(100_000).map(:total) } | |
| end | |
| $ ruby bm.rb | |
| user system total real |
| 1000000 documents | |
| 249819 documents with non-empty 'search_query' | |
| user system total real | |
| simple map/reduce 0.270000 0.010000 0.280000 (353.701946) | |
| simple aggregation 0.180000 0.010000 0.190000 ( 8.049170) | |
| filtering map/reduce 0.250000 0.010000 0.260000 (337.955130) | |
| filtering aggregation 0.150000 0.010000 0.160000 ( 4.095468) |
| # Mongoid inline relation definitions. Ruby makes it so easy. | |
| # (`data` is effectively just a shortcut for `inline_embed_one(:data)` there.) | |
| # | |
| # Yes, it would make sense to create separate models, but my case is different. | |
| # This application is used to track events of other apps, such as purchase, and | |
| # it makes *more* sense to embed all order-related data. Instead of having model | |
| # overload for each event being tracked, I just define them inline. | |
| class OrderEvent | |
| include Analyzing::Event |