Skip to content

Instantly share code, notes, and snippets.

View gchiam's full-sized avatar

Gordon Chiam gchiam

View GitHub Profile
:root {
--nord0: #2E3440;
--nord1: #3B4252;
--nord2: #434C5E;
--nord3: #4C566A;
--nord4: #D8DEE9;
--nord5: #E5E9F0;
--nord6: #ECEFF4;
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;
}
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 {
@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)
@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 / Crostini_font.js
Created September 6, 2020 09:12
Set custom don't under Crostini
term_.prefs_.set('font-family', '"Iosevka Nerd", monospace');
term_.prefs_.set('user-css', 'https://cdn.jsdelivr.net/gh/gchiam/nerd-web-fonts@v0.1.0/css/iosevka/iosevka-light-nerd-font.css');
@gchiam
gchiam / resouce.java
Created August 18, 2020 04:07
Execute Around Method Pattern - Resource
/* Extracted from https://www.youtube.com/watch?v=xF0rupA848E */
class Resource {
public Resource() {
System.out.println("created...");
}
public Resource op1() {
System.out.println("op1...");
return this;
MAPPING = {
'{': '}',
'(': ')',
'[': ']',
}
def is_open(c):
return c in MAPPING
@font-face {
font-family: "Iosevka Nerd";
font-weight: normal;
font-style: normal;
src: url("https://cdn.jsdelivr.net/gh/ryanoasis/nerd-fonts@2.0.0/patched-fonts/Iosevka/Extra-Light/complete/Iosevka%20Term%20Extralight%20Nerd%20Font%20Complete%20Mono.ttf") format('truetype');
}
@font-face {
font-family: "Iosevka Nerd";
font-weight: normal;
font-style: italic;
@font-face {
font-family: "Fura Code Nerd";
font-weight: normal;
src: url("https://cdn.jsdelivr.net/gh/ryanoasis/nerd-fonts@2.0.0/patched-fonts/FiraCode/Light/complete/Fura%20Code%20Light%20Nerd%20Font%20Complete%20Mono.otf") format('opentype');
}
@font-face {
font-family: "Fura Code Nerd";
font-weight: bold;
src: url("https://cdn.jsdelivr.net/gh/ryanoasis/nerd-fonts@2.0.0/patched-fonts/FiraCode/Medium/complete/Fura%20Code%20Medium%20Nerd%20Font%20Complete%20Mono.otf?raw=true") format('opentype');
}