Skip to content

Instantly share code, notes, and snippets.

👁
{ this.props.status }

Thorsten Lorenz thlorenz

👁
{ this.props.status }
Block or report user

Report or block thlorenz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am thlorenz on github.
  • I am thlorenz (https://keybase.io/thlorenz) on keybase.
  • I have a public key ASDi53IJKgU2P7pjH8Aepd3pnhwCfFWfL7s7VHVBAuHPMwo

To claim this, I am signing this object:

@thlorenz
thlorenz / _obs-settings-slow-internet.md
Last active Nov 24, 2018
[settings] OBS settings for streaming with not so great internet
View _obs-settings-slow-internet.md

OBS Low Internet Settings

These were provided to me by @feross at some point and then I tweaked them to work with slow internet, i.e. 1MBPS up.

I'm posting the the screenshots of those settings in the comments and I added two files that I found via File/Show Profile Folder

@thlorenz
thlorenz / deoptmark.js
Last active Aug 13, 2018
Provide benchmark.js interface to just run functions meant to be benchmarked, i.e. to collect deoptimization info
View deoptmark.js
'use strict'
const deferred = {
resolve: function dontCare() {}
}
class DeoptMark {
constructor({ ITER = 1E3 } = {}) {
this._ITER = ITER
this._fns = []
@thlorenz
thlorenz / Understanding why the new V8 is so Damn Fast, One Demo at a Time.md
Last active May 23, 2018
[tallk] Understanding why the new V8 is so Damn Fast, One Demo at a Time
View Understanding why the new V8 is so Damn Fast, One Demo at a Time.md

Understanding why the new V8 is so Damn Fast, One Demo at a Time

Abstract

The entire V8 compiler architecture as well as large parts of the Garbage Collector where updated recently. TurboFan replaced Crankshaft, Orinoco now collects garbage in parallel whenever possible. Node.js v8 shipped with this new and improved version of V8. As a result we can finally write idiomatic and declarative JavaScript without worrying about incurring performance overhead due to JavaScript compiler shortcomings.

At least this is what the V8 team tells us. In this talk we will explore if and why this is true, one demo at a time.

@thlorenz
thlorenz / async-wrap-express-wrapper.md
Last active Aug 26, 2018
async/wrap express wrapper
View async-wrap-express-wrapper.md

Summary

Tried to improve debugging when an express middleware is wrapped to auto-handle errors of an asnync function.

Turns out the below reads a bit better than a return Promise.catch() implementation, but still, once we reach the central express error handler, the line of the wrapped function that caused the error isn't included.

Implementation

'use strict'
@thlorenz
thlorenz / clean-dupes.js
Created Feb 22, 2017
Remove duplicate files found inside one directory
View clean-dupes.js
#!/usr/bin/env node
const fs = require('fs')
const path = require('path')
function bySizeThenByName(a, b) {
if (a.size === b.size) {
return a.path.localeCompare(b)
}
return a.size < b.size
@thlorenz
thlorenz / collaborating.md
Last active Dec 16, 2017
A quick guideline to contributing to my open source projects
View collaborating.md

Collaborator Guidelines

Now where you are a collaborator you have certain powers that you should use carefully, so I'm listing some guidelines here.

Contributing

Proposing a Change

Even though as a contributor you could push directly to master, please don't do that. Instead each bug fix or feature

@thlorenz
thlorenz / update_to_nan_v2.0.x.sh
Last active Oct 13, 2016
Script to update Node.js addons to work with nan 2.0.x and thus with iojs v3.x (gets you 90% there)
View update_to_nan_v2.0.x.sh
#!/bin/bash
replacements=(
"NanAsyncWorker/Nan::AsyncWorker"
"NanAsyncQueueWorker/Nan::AsyncQueueWorker"
"NanCallback/Nan::Callback"
"NanSetInternalFieldPointer/Nan::SetInternalFieldPointer"
"NanGetInternalFieldPointer/Nan::GetInternalFieldPointer"
"NanNewBufferHandle\\(([^;]+);/Nan::NewBuffer(\\1.ToLocalChecked();"
"(NanNew(<(v8::)?String>)?\\(\"[^\"]*\"\\))/\\1.ToLocalChecked()"
@thlorenz
thlorenz / Copy Netflix List.md
Last active Aug 29, 2015
Copy Netflix List sorted by title to Clipboard
View Copy Netflix List.md
  1. Go to My List
  2. Open DevTools
  3. Paste the below code into the console
  4. Hit Enter
  5. Your list is in your clipboard sorted by title
var cards = document.getElementsByClassName("smallTitleCard"), s = [], title;
for (var i = 0; i < cards.length; i++) {
  title = cards.item(i).attributes.getNamedItem('aria-label').textContent;
@thlorenz
thlorenz / autostep-gdb.md
Last active Oct 16, 2019
gdb: automatically step through a binary one instruction at a time and log registers at each step
View autostep-gdb.md

gdbinit

set disassemble-next-line on
set dissasembly-flavor intel

b _start
run

while 1
You can’t perform that action at this time.