Skip to content

Instantly share code, notes, and snippets.

four spaces
two spaces and a tab
four spaces
@dsummersl
dsummersl / tabSpaceTab
Created April 10, 2014 17:13
3 lines: tabs, spaces, tabs
tab
space
tab
@dsummersl
dsummersl / gist:10403425
Created April 10, 2014 17:15
3 lines: space, tab, space
space
tab
space
@dsummersl
dsummersl / gist:11085439
Created April 19, 2014 14:10
.env.openshift
# ==== Required configuration settings for Huginn ====
# Replace the following with the output from "rake secret"
# (unnecessary, since we'll be using the OpenShift-provided secret)
# APP_SECRET_TOKEN=REPLACE_ME_NOW!
# This is the domain where your Huginn instance will be running. The default should work
# for development, but it needs to be changed to your Huginn domain when you deploy to a
# production environment (e.g., yourdomain.com, possibly including a port).
DOMAIN=$OPENSHIFT_APP_DNS
@dsummersl
dsummersl / gist:2b9faa9133322c33b465
Created November 24, 2014 19:04
:bda command to clear out hidden buffers
" delete all buffers function
function! DeleteHiddenBuffers()
let tpbl=[]
call map(range(1, tabpagenr('$')), 'extend(tpbl, tabpagebuflist(v:val))')
for buf in filter(range(1, bufnr('$')), 'bufexists(v:val) && index(tpbl, v:val)==-1')
silent execute 'bwipeout' buf
endfor
endfunction
cabbrev bda call DeleteHiddenBuffers()
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