This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// toCSV | |
var toCSV = function(data, options){ | |
var headers = []; | |
var records = []; | |
var line; | |
var response = ''; | |
var i, l = data.length, rl=0, j, k; | |
var reReplaceTextDelim; | |
var processRecord = function(src, rec, prefix){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> _ = require('lodash'); | |
{ [Function: lodash] | |
support: { funcDecomp: true, funcNames: true }, | |
templateSettings: | |
{ escape: /<%-([\s\S]+?)%>/g, | |
evaluate: /<%([\s\S]+?)%>/g, | |
interpolate: /<%=([\s\S]+?)%>/g, | |
variable: '', | |
imports: { _: [Circular] } }, | |
after: [Function: after], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
import "math/big" | |
func main() { | |
bound_left := new(big.Rat) | |
bound_left.SetFloat64(0.5) | |
bound_right := new(big.Rat) | |
bound_right.SetFloat64(1.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select distinct st.pid, | |
current_timestamp - st.query_start as locked_time, | |
st.state, | |
st.usename, | |
st.client_hostname, | |
st.application_name | |
from pg_locks l | |
inner join pg_stat_activity st on l.pid = st.pid | |
where st.datname = 'analytics_master' | |
order by current_timestamp - st.query_start desc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- ensure latest of master (or rebase source) | |
- (in dest branch) git rebase -i master | |
- follow direction, don't forget you need to `git add` changed files | |
- if there is a conflict | |
- you can fix it manually | |
- or if you want to just use HEAD: `git checkout HEAD -- path/to/file.js` | |
- git push -f origin {branch-name} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Example Output: | |
➜ go run partitioned_loops.go | |
Starting... | |
simpleFor result: 468767562500, time: 0.013604745000000001 sec | |
goForEach result: 468767562500, time: 24.106190332 sec | |
goPartitioned result: 468767562500, time: 0.004296383 sec | |
*/ | |
package main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//defaut settings | |
var DEFAULT_SIZE = 1000*1024, | |
DEFAULT_CHUNK_SIZE = 250*1024, | |
MAX_CHUNK_SIZE = 500*1024; | |
var http = require('http'), | |
url = require('url'), | |
buffer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cnt, mes, s, sender, util, zmq, ms; | |
ms = 1000; | |
zmq = require('zeromq'); | |
util = require('util'); | |
s = zmq.createSocket('pub'); | |
s.bind('tcp://127.0.0.1:5559', function(err) { | |
if (err) { | |
throw err; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cnt, mes, s, sender, util, zmq, ms; | |
ms = 1000; | |
zmq = require('zeromq'); | |
util = require('util'); | |
s = zmq.createSocket('pub'); | |
s.bind('tcp://127.0.0.1:5559', function(err) { | |
if (err) { | |
throw err; |