Skip to content

Instantly share code, notes, and snippets.

@wvteijlingen
wvteijlingen / index.js
Last active July 20, 2019 12:36
HOC for react-navigation that maps params to props
import paramsToProps from 'paramsToProps.js'
const MainNavigator = StackNavigator({
firstScreen: { screen: paramsToProps(FirstScreenComponent) },
secondScreen: { screen: paramsToProps(SecondScreenComponent) },
});
#!/usr/bin/env ruby
require 'open-uri'
require 'pathname'
require 'json'
def strip_hash(f)
ext = f.extname
if ext.include?("?")
@tafkey
tafkey / git_overview
Last active October 19, 2023 15:15
Print git status of all repositories under the current folder
find . -type d -name '.git' | while read dir ; do sh -c "cd $dir/../ && echo -e \"\nGIT STATUS IN ${dir//\.git/}\" && git status -s" ; done
@Joris-van-der-Wel
Joris-van-der-Wel / v8-profiler.js
Last active October 27, 2021 04:03
node.js profiling: generate .cpuprofile which can be opened in chrome dev tools (F12)
'use strict';
var profiler = require('v8-profiler');
profiler.startProfiling();
// ...
var cpuProfile = profiler.stopProfiling();
require('fs').writeFileSync(__dirname + '/foo.cpuprofile', JSON.stringify(cpuProfile));