Skip to content

Instantly share code, notes, and snippets.

View thlorenz's full-sized avatar
👁️
{ this.props.status }

Thorsten Lorenz thlorenz

👁️
{ this.props.status }
View GitHub Profile
@thlorenz
thlorenz / SourceMaps.md
Created December 29, 2013 21:44
SourceMaps explained

Source Maps explained

Sourcemaps are becoming more and more part of our development stack and understanding them sooner or later is essential.

I'll give a quick run down on the following regarding source maps:

  • how are they structured
  • the different formats and how to encode/decode them
  • where they are used (JavaScript transpilers, CSS transpilers, bundlers)
  • how does the browser find and consumer source maps
from ubuntu:12.10
maintainer Thorsten Lorenz <thlorenz@gmx.de>
run apt-get update
run apt-get upgrade -y
run apt-get install -y build-essential
add . /src
from dockerfile/nodejs
add https://github.com/thlorenz/redeyed/archive/v0.4.4.tar.gz /src
workdir /src
entrypoint [ "npm" ]
/*
Browserify Live Demos!
How to make your own:
1. Clone this RequireBin
2. Adjust the REQUIRES section
3. Create a gist with demo snippets that can be run
4. Put the id for that gist into the demoGist variable
*/
/* REQUIRES: Put modules you need in your demo in this Array */
@thlorenz
thlorenz / index.js
Created June 14, 2014 17:50
requirebin sketch
var d3Gauge = require('d3-gauge')
, xtend = require('xtend')
, insertCss = require('insert-css')
var gauges = [];
var small = {
size : 100
, min : 0
, max : 50
, transitionDuration : 500
@thlorenz
thlorenz / builiding-lldb-on-mac-with-jit-support-simple-steps.md
Last active July 24, 2019 01:32
Building lldb with GDB JIT support on Mac OSX.

Building lldb on Mac

Create Codesign Certificate

First we need to create a certificate. The llvm provided a way to do that, but I found this way to work slightly better for me. Just substitute lldb_codesign for the certificate name, instead of gdb-cert.

Install swig dependency

@thlorenz
thlorenz / .generating-xcode-via-gyp.md
Last active August 26, 2018 15:05
Generating Xcode projects from Node.js binding repos via gyp

This is specifically tailored to Node.js binding projects in which case the C++ layer is always a library.

Clone gyp:

git clone --depth 1 https://chromium.googlesource.com/external/gyp.git gyp

Add the below common.gypi file in the root of the project.

@thlorenz
thlorenz / perf.md
Created August 16, 2014 18:07
perf related one liners

perf list

pl-csv alias

Remove first 3 lines of perf list output and join the remaining ones together with ,

alias pl-csv='tail -n+3 | grep -v ^$ | awk '\''{print $1}'\'' | tr "\\n" "," | sed -e s/,$//'
@thlorenz
thlorenz / Encryption and Decryption with the crypto module: cipher-API-replpad-log
Last active August 29, 2015 14:10
Encryption and Decryption with the crypto module
pad > crypto.getHashes().length
46
pad > crypto.getCiphers().length
108
crypto.getHashes()
[ 'DSA',
'DSA-SHA',
'DSA-SHA1',
@thlorenz
thlorenz / Reusing Errors vs. creating new Error with stack attached.md
Last active August 26, 2018 15:12
Reusing Errors vs. creating new Error with stack attached

It is not usually recommended to reuse errors since the stack trace is attached whenever the error is instantiated.

However in some cases the overhead of doing that may affect performance, especially if the error is an exception that is known to occur frequently and is handled.

Only in these cases it may be advantagous to reuse the created Error. In all other cases getting a full stacktrace created at the time the exception occurs is to be preferred as it gives much better information needed to debug the problem.

Run

➝ node errors.js