Skip to content

Instantly share code, notes, and snippets.

View fl0w's full-sized avatar
🎉
50% hackin', 50% slackin'

Martin Iwanowski fl0w

🎉
50% hackin', 50% slackin'
  • Sweden, Stockholm
View GitHub Profile
'use strict'
// const v8 = require('v8-natives')
const Benchmark = require('benchmark')
const suite = new Benchmark.Suite()
const MixinOne = (Base) => class extends Base {}
const MixinTwo = (Base) => class extends Base {}
const MixinThree = (Base) => class extends Base {}
const MixinFour = (Base) => class extends Base {}
@fl0w
fl0w / bench-mixin.js
Last active March 21, 2017 13:58
trying to catch performance impact of mixins in node
'use strict'
const v8 = require('v8-natives')
// requires node v6+ as --allow-natives-syntax is changed
const Benchmark = require('benchmark')
const suite = new Benchmark.Suite()
const MixinOne = (Base) => class extends Base {}
const MixinTwo = (Base) => class extends Base {}
# lazyload nvm
# all props goes to http://broken-by.me/lazy-load-nvm/
# grabbed from reddit @ https://www.reddit.com/r/node/comments/4tg5jg/lazy_load_nvm_for_faster_shell_start/
lazynvm() {
unset -f nvm node npm npx
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
if [ -f "$NVM_DIR/bash_completion" ]; then
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
@fl0w
fl0w / index.js
Created June 6, 2016 22:36
global Promise monkey patch reminder
// for vanilla js
global.Promise = require('bluebird')
// for babel js
// put in your bootstrap
require('babel-runtime/core-js/promise').default = require('bluebird');
'use strict'
let i = setInterval(() => {
console.log('x')
}, 0)
function run() {
console.log('.')
process.nextTick(run)
}
@fl0w
fl0w / purge-atom.sh
Created December 18, 2015 10:22
Purge atom from Mac OS X
# completely remove atom on mac os x
rm -r ~/.atom
rm -r /usr/local/bin/atom
rm -r /usr/local/bin/apm
rm -r /Applications/Atom.app
rm -r ~/Library/Preferences/com.github.atom.plist
rm -r ~/Library/Application\ Support/com.github.atom.ShipIt
rm -r ~/Library/Application\ Support/Atom
rm -r ~/Library/Saved\ Application\ State/com.github.atom.savedState
# completely remove atom on mac os x
rm -r ~/.atom
rm -r /usr/local/bin/atom
rm -r /usr/local/bin/apm
rm -r /Applications/Atom.app
rm -r ~/Library/Preferences/com.github.atom.plist
rm -r ~/Library/Application\ Support/com.github.atom.ShipIt
rm -r ~/Library/Application\ Support/Atom
rm -r ~/Library/Saved\ Application\ State/com.github.atom.savedState
rm -r ~/.atom
rm -r /usr/local/bin/atom
rm -r /usr/local/bin/apm
rm -r /Applications/Atom.app
rm -r ~/Library/Preferences/com.github.atom.plist
rm -r ~/Library/Application\ Support/com.github.atom.ShipIt
rm -r ~/Library/Application\ Support/Atom
rm -r ~/Library/Saved\ Application\ State/com.github.atom.savedState
rm -r ~/Library/Caches/com.github.atom
rm -r ~/Library/Caches/Atom
@fl0w
fl0w / purge-atom.sh
Last active December 18, 2015 10:21
# completely remove atom on mac os x
rm -r ~/.atom
rm -r /usr/local/bin/atom
rm -r /usr/local/bin/apm
rm -r /Applications/Atom.app
rm -r ~/Library/Preferences/com.github.atom.plist
rm -r ~/Library/Application\ Support/com.github.atom.ShipIt
rm -r ~/Library/Application\ Support/Atom
rm -r ~/Library/Saved\ Application\ State/com.github.atom.savedState
@fl0w
fl0w / keybase.md
Created September 6, 2015 16:57
keybase.md

Keybase proof

I hereby claim:

  • I am fl0w on github.
  • I am fl0w (https://keybase.io/fl0w) on keybase.
  • I have a public key whose fingerprint is C489 BC82 CEA3 E609 334C 0CEC BD7E 9C67 1B07 F16F

To claim this, I am signing this object: