Skip to content

Instantly share code, notes, and snippets.

var express = require("express");
var app = express();
app.use(function(req, res, next) {
setTimeout(function() {
console.log("("+ process.pid +"): "+ new Date() +" XXX");
res.end("X");
},5000);
console.log("("+ process.pid +"): "+ new Date() +" handles="+ process._getActiveHandles().length +" requests="+ process._getActiveRequests().length);
});
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
var dns = require("dns");
var count = 0;
var gotResponse = true;
setInterval(function () {
var cnt = ++count;
if (gotResponse) {
gotResponse = false;
console.time("dnslookup"+ cnt);
readFile("some/file.txt").then(function(stream) {
stream
.pipe(es.split('\n'))
.map(function(data) { return data.substring(5); });
});
for (line, logstr) in zip(lines, text):
line = "".join(line)
if len(line.strip()) == 0: continue
result.append(["%-*s" % (2 * indentation_level, line), logstr])
x27[?25lx27[1Fx27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;0m x27[48;5;22m x27[48;5;64m x27[48;5;64m x27[48;5;2m x27[48;5;76m x27[48;5;76m x27[48;5;76m x27[48;5;76m x27[48;5;2m x27[48;5;64m x27[48;5;28m x27[48;5;22m x27[48;5;22m x27[48;5;64m x27[48;5;28m x27[48;5;34m x27[48;5;28m x27[48;5;64m x27[48;5;34m x27[48;5;64m x27[48;5;28m x27[48;5;28m x27[48;5;64m x27[48;5;34m x27[48;5;64m x27[48;5;64m x27[48;5;64m x27[48;5;64m x27[48;5;22m x27[48;5;22m x27[48;5;22m x27[48;5;22m x27[48;5;0m x27[48;5;22m x27[48;5;0m x27[48;5;0m x27[48;5;22m x27[48;5;0m x27[48
2015-04-02_20:15:54.15087 #
2015-04-02_20:15:54.15088 # Fatal error in a, line 11
2015-04-02_20:15:54.15089 # c
2015-04-02_20:15:54.15089 #
2015-04-02_20:15:54.15090
2015-04-02_20:15:54.15153 {"name":"flurry","hostname":"ip-172-31-29-187","pid":7838,"level":30,"headers":{"host":"mobile.btrll.com","content-type":"application/json","user-agent":"Apache-HttpAsyncClient/4.0-beta4 (java 1.5)","x-openrtb-version":"2.1","x-forwarded-for":"216.52.203.134","x-forwarded-port":"80","x-forwarded-proto":"http","content-length":"1937","connection":"keep-alive"},"url":"/ad?integration=flurry","POST":{"id":"7bcd7068-08d5-4c63-a723-8f822b336b53","imp":[{"id":"1fc563cb-b6f6-4ec2-8cf8-b3e2863328d3","banner":{"w":480,"h":320,"ext":{"rewarded":0,"video":{"mimes":["video/mp4"],"linearity":1,"minduration":1,"maxduration":30,"minbitrate":0,"maxbitrate":500,"protocol":[1,2,3],"w":320,"h":480,"ext":{"rewarded":1,"video_skippable":"BLOCK_SKIPPABLE","skip_offset":30,"ad_group_id":"flurry_in_network"},"playbackmethod":[1]}},"pos":0,"bt
@dsummersl
dsummersl / keybase.md
Created April 15, 2015 04:15
keybase.md

Keybase proof

I hereby claim:

  • I am dsummersl on github.
  • I am ntx3holc (https://keybase.io/ntx3holc) on keybase.
  • I have a public key whose fingerprint is 30D7 EB1C 3C2A B919 3036 B2E3 2834 CC62 9693 E1BD

To claim this, I am signing this object:

" Execute something on all files of the same kind:
"
" See GG and AA commands:
function! s:ExecFileType(cmd,search)
let extension = substitute(expand('%'),'\v^.*\.',"","")
exec printf("silent %s",printf(a:cmd,a:search,extension))
endfunction
command! -nargs=1 GG call s:ExecFileType("Ggrep %s -- '*.%s'",'<args>')
command! -nargs=1 AA call s:ExecFileType("Ag %s **/*.%s",'<args>')
var config = require("./app/code/js/server/Config");
var _ = require("lodash");
process.env.DARKROLL_ENV = process.argv[2];
var configs = config.withRequest({});
console.log("|process.env.DARKROLL_ENV = "+ process.env.DARKROLL_ENV);
_.each(_.keys(configs),function(k) {
console.log(k +" = "+ JSON.stringify(configs[k]));
});
2015-08-23_17:21:03.65125 GET /event/impression?ts=1440350461429&siteId=3862927&lineItemId=120349&resource=%2Fvast%3Fit%3Da%26br_dpidstype%3Da%26siteId%3D3862927%26platform%3DiPhone%2BOS%26n%3D52685%26br_ip%3D73.161.43.138%26br_osvers%3D6.1.6%26br_ua%3DMozilla%252F5.0%2B%2528iPod%253B%2BCPU%2BiPhone%2BOS%2B6_1_6%2Blike%2BMac%2BOS%2BX%2529%2BAppleWebKit%252F536.26%2B%2528KHTML%252C%2Blike%2BGecko%2529%2BMobile%252F10B500%2BPerk%2BTV%2B%2528PTVIPH%2529%252F2.7.0%2BAerServSDK%252F2.25.2.1%26br_dpidu%3D8D3DF824-A62A-460B-8BBD-4BB0592E1880%26br_appurl%3Dhttps%253A%252F%252Fitunes.apple.com%252Fus%252Fapp%252Fperk-tv-get-rewards-when-you%252Fid706630901%253Fmt%253D8%26br_sdkvers%3D2.25.2.1%26br_appname%3DPerk%2BTV%26br_domain%3Dwww.perk.com%26br_bundle%3Dcom.jutera.perktv%26br_carrier%26br_network%3Dwifi%26br_pageurl%3Dwww.perk.com%26br_dnt%3Dfalse%26br_dpids%3D%26br_dpidutype%3Di%26br_make%3DApple%2BInc.%26br_model%3DiPod%2Btouch%26br_nplat%3D42.728%26br_nplon%3D-83.147&s=mobile-prod-aws 302 1ms - 70
2015-08-23_17