NodeJS cheasheet

Remote debug nodejs app / use chrome developers to detect memory leaks Step 1 enable remote debug on a running nodejs process 1kill -SIGUSR1 $NODEJS_PID Now your nodejs process (V8) is listening on po

JavaScript cheasheet

Add replaceAll function to existing String object 1234String.prototype.replaceAll = function(search, replacement) { var target = this; return target.replace(new RegExp(search, 'g'), replace

Java cheasheet

1System.out.printf("%3d ", n); // print number with spaces. 1Arrays.copyOfRange([1,2,3], 1, [1,2,3].length); // subarray from 1 to length array Initialize 2 dim array 1int[][] arr = new int[2][2];

Python cheasheet

Get content of URL 12import urllib2print urllib2.urlopen('').read() Remove chars and split by , from a string convert to list 1'jshfjshfjsh[]'.translate(None, '[] "\n').split(',') Dif

SQL cheasheet

In same query you can refer to same table twice 12345select firstname, lastname from names as a, names as b WHERE a.firstname = b.firstname AND a.lastname != b.lastname

SBT for dummies

files/–build.sbt/–project/MyBuild.scala/–src/–main build.sbt - main build script with DSL imports implicitly sbt._ and sbt.Keys._project folder - the build scripts and scala source are compiled to her

Squash multiple push in git

And my way of squashing multiple push is (perhaps you pushed to your own branch many commits and now you wish to do a pull request and you don’t want to clutter them with many commits which you have a