Skip to content

Instantly share code, notes, and snippets.

View sebastianhoitz's full-sized avatar
🎯
Focusing

Sebastian Hoitz sebastianhoitz

🎯
Focusing
View GitHub Profile
@sebastianhoitz
sebastianhoitz / StreamingResponse.coffee
Last active December 26, 2022 07:06
node.JS streaming zip file
zipstream = require "zipstream"
fs = require "fs"
async = require "async"
class StreamingResponse
filename: ""
files: []
streaming: true
###
@sebastianhoitz
sebastianhoitz / instrumenting_mongodb.coffee
Last active December 13, 2015 19:39
nodeJS mongoDB instrumentation – This allows you to profile all queries to your mongoDB collection, including collectionName, special find parameters and conditions.
collection = require("mongodb/lib/mongodb/collection").Collection
oldFind = collection.prototype.find
collection.prototype.find = ->
tagName = "#{@db.databaseName}/#{@collectionName}/find"
findParameters = arguments[1]
start = +new Date()
cursor = oldFind.apply @, arguments
@sebastianhoitz
sebastianhoitz / etc-init.d-graylog2.sh
Last active December 16, 2015 19:49 — forked from marzocchi/etc-init.d-graylog2.sh
This version works with the current graylog 0.10 graylog2ctl script
#! /bin/sh
### BEGIN INIT INFO
# Provides: Graylog2
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts Graylog2
# Description: Starts Graylog2 using start-stop-daemon
### END INIT INFO
@sebastianhoitz
sebastianhoitz / keybindings.json
Last active March 16, 2023 20:00
VSCode Vim improvements
[
{
"key": "ctrl+h",
"command": "workbench.action.focusLeftGroup",
"when": "editorTextFocus && vim.active && vim.mode != 'Insert'"
},
{
"key": "ctrl+l",
"command": "workbench.action.focusRightGroup",
"when": "editorTextFocus && vim.active && vim.mode != 'Insert'"