I hereby claim:
- I am justinfreitag on github.
- I am justinfreitag (https://keybase.io/justinfreitag) on keybase.
- I have a public key whose fingerprint is F779 C5C1 D5A8 1583 A3FE 897C 35E1 A730 9F69 2E40
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| var Redis = require('redis'), | |
| toArray = require('../lib/to-array'); | |
| var bucketSpan = 10, | |
| redis = Redis.createClient(), | |
| zeroTimeKey = 'message:history:0:time'; | |
| function getBucketId(timestamp) { | |
| timestamp = Math.floor(timestamp / 1000); | |
| if (timestamp >= (zeroTime + bucketSpan)) { |
| coco = require \coco | |
| vm = require \vm | |
| export evaluate = (code, options = {}) -> | |
| return unless code = code.trim! | |
| Script = vm.Script | |
| if Script | |
| if options.sandbox? | |
| if options.sandbox instanceof Script.createContext!.constructor | |
| sandbox = options.sandbox |
| caffienateMethod = (server, name) -> | |
| originalName = '_' + name | |
| server[originalName] = server[name] | |
| server[name] = (route, callback) -> | |
| server[originalName] route, (request, response, next, param) -> | |
| @[route] = param unless not param? | |
| [@request, @header, @query, @params, @body] = [request, request.header, \ | |
| request.query, request.params, request.body] | |
| @response = response | |
| @json = (object, args...) -> @response.json object, args |