Skip to content

Instantly share code, notes, and snippets.

@GabLeRoux
GabLeRoux / .editor
Created September 30, 2015 16:32
Atom split selection into lines (Sublime Text's ctrl+shift+l) From https://discuss.atom.io/t/multiple-selections/755/45
'.platform-win32 .editor, .platform-linux .editor':
'ctrl-shift-L': 'editor:split-selections-into-lines'
'ctrl-shift-up': 'editor:add-selection-above'
'ctrl-shift-down': 'editor:add-selection-below'
@staltz
staltz / introrx.md
Last active May 7, 2024 09:38
The introduction to Reactive Programming you've been missing
@ngandriau
ngandriau / Sandbox.groovy
Created July 6, 2013 17:34
surprise when using string variable/constant as Map's key
// Illustration of a side effect when using string variable/constant for map's key
def PROP_NAME = "property name"
def myMap = [PROP_NAME: "a Value"]
//assert myMap.keySet().iterator().next() == "property name"
// fails at runtime but it compiles.
// I was expecting the value of the variable to be the key, but it is in fact a String with the name of the variable
@kdabir
kdabir / DecimalFormatExample.java
Created February 23, 2012 05:45
Using DecimalFormat in java/groovy
import java.text.DecimalFormat;
...
DecimalFormat df = new DecimalFormat("###,##0.00");
df.format(number);
// in the format string,
// # -> shows Digit if present else blank
// 0 -> shows Digit if present else 0
// details at : http://docs.oracle.com/javase/6/docs/api/java/text/DecimalFormat.html