Skip to content

Instantly share code, notes, and snippets.

View hkmoon's full-sized avatar

HongKee Moon hkmoon

  • MPI-CBG
  • Dresden
View GitHub Profile
@hkmoon
hkmoon / private.xml
Created October 5, 2015 20:19
Key mappings for Karabiner
<?xml version="1.0"?>
<root>
<item>
<name>Mapping hjkl on left up down and right</name>
<identifier>private.mapping_hjkl_on_arrow</identifier>
<autogen>__KeyToKey__
KeyCode::H, ModifierFlag::CONTROL_L,
KeyCode::CURSOR_LEFT
</autogen>
<autogen>__KeyToKey__
@hkmoon
hkmoon / StreamMap.java
Last active September 15, 2015 08:57
Java 8: stream(), map() and collect()
// In Java 8, there are stream(), map() and collect() for better collection manipulation
ArrayList<String> list = new ArrayList<>();
for(Person person : people)
{
list.add( person.getNickName() );
}
// The above code is shortened with the below
List<String> list = people.stream().map( Person::getNickName ).collect( Collectors.toList() );