Skip to content

Instantly share code, notes, and snippets.

View gchiam's full-sized avatar

Gordon Chiam gchiam

View GitHub Profile
@gchiam
gchiam / move-visual-selection.vim
Created October 6, 2020 16:16
VIM - Move visual selection
" Move visual selection
vnoremap J :m '>+1<cr>gv=gv
vnoremap K :m '<-2<cr>gv=gv
@gchiam
gchiam / java_8_boolean_permutation.java
Created October 9, 2020 05:21
Generate permutations of Boolean values
Stream.of(true, false)
.map(b2 -> Stream.of(true, false)
.map(b3 -> List.of(b2, b3))
.collect(Collectors.toList()))
.flatMap(Collection::stream)
.collect(Collectors.toList());
// [[true, true], [true, false], [false, true], [false, false]]
Stream.of(true, false)
import java.util.concurrent.TimeUnit;
/**
* Simple Java Program to show how to execute threads in a particular order. You
* can enforce ordering or execution sequence using Thread.join() method in
* Java. * * @author Javin Paul
*/
public class JoinDemo {
html.simplify.darkTheme .zA .a4W .at[style*="#ddd"] {
background-color: #3B4252 !important;
}
html.simplify.boldHighlight.darkTheme {
--color-focused: #5E81AC;
}
html.simplify.darkTheme .yO.x7,
html.simplify.darkTheme .x7 {
background: #434C5E;
}
:root {
--nord0: #2E3440;
--nord1: #3B4252;
--nord2: #434C5E;
--nord3: #4C566A;
--nord4: #D8DEE9;
--nord5: #E5E9F0;
--nord6: #ECEFF4;