Skip to content

Instantly share code, notes, and snippets.

View sverweij's full-sized avatar
🌪️
fighting entropy

Sander Verweij sverweij

🌪️
fighting entropy
View GitHub Profile
@sverweij
sverweij / profile-node-code.js
Created May 10, 2018 20:01
Profile node code
// source: https://developer.ibm.com/node/2016/01/06/tips-optimizing-slow-code-in-nodejs/
// the resulting logfile can be imported into google chrome's JavaScript profiler (which seems
// to be deprecated???)
const profiler = require('v8-profiler');
const fs = require('fs');
let profilerRunning = false;
function toggleProfiling () {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sverweij
sverweij / uitklappertjes_details.md
Last active April 5, 2017 07:58
Uitklappertjes in github markdown

Here is stuff.

Here's the uitklappertje. With all kinds of stuff.
console.log('hi');
http://broken-by.me/lazy-load-nvm/
@sverweij
sverweij / poor-mans-html-lint.html
Created March 12, 2017 09:37
poor man's html lint
<style>
*[style],
a:not([href])
a[href="#"],
a[href=""],
a[href*="javascript:void(0)"],
img:not([alt]):not(aria-hidden="true"),
img[alt=""],
html:not([lang]),
html[lang=""],
# you can check that with ssh-add
ssh-add -l
# response when these steps need to be taken: 'The agent has no identities.'
# response when everything ok would be more like: '2048 SHA256:yourkey /Users/youryousername/.ssh/id_rsa (RSA)'
# start the ssh-agent
ssh-agent -s
# add your keys.
ssh-add ~/.ssh/id_rsa
Good font with ligatures: Fira Code
Embedding a font in a package: https://github.com/adilparvez/atom-hasklig
@sverweij
sverweij / gist:70258f4f33639f8f60467bc22189748d
Created December 15, 2016 20:41
git log format - add this to your .git/config
[format]
pretty = %Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset
@sverweij
sverweij / get-typescript-dependencies.md
Last active March 2, 2017 20:59
Get dependencies of a typescript code base with dependency-cruiser

The recipe in previous revisions of this gist is obsolete as dependency-cruiser supports typescript (and coffeescript, livescript) out of the box since december 2016, so it's currently as simple as:

npm i --global dependency-cruiser

# ... assuming your source is in src, you can dump the dependencies 
# (including those in node_modules) to a file with:
depcruise -T json -f dependencies.json src

# or if you want to make a graph - send it through graphviz dot