Skip to content

Instantly share code, notes, and snippets.

View ferrwan's full-sized avatar
🐳

Ferry Irawan ferrwan

🐳
  • Indonesia
View GitHub Profile
@ferrwan
ferrwan / .vimrc
Last active May 1, 2021 06:50
My vim setup
" set rtp+=$HOME/.local/lib/python2.7/site-packages/powerline/bindings/vim/
""""""""""""""""""""""""""""""""""""""""
" vim-plug
""""""""""""""""""""""""""""""""""""""""
call plug#begin('~/.vim/plugged')
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tpope/vim-fugitive'
@ferrwan
ferrwan / times.js
Last active March 7, 2018 07:58
Iterator HOF.
const MAX_NUMBER = Number.MAX_SAFE_INTEGER // (2^53 - 1) = 9007199254740991
/**
* Iterator HOF
* @param {number} n
* @param {Function} loop
* @returns void
*/
const times = (n = 0, loop): void => {
if (n > MAX_NUMBER) {
@ferrwan
ferrwan / console-colors.js
Last active June 19, 2018 10:17
List of Console Colors
const Reset = "\x1b[0m"
const Bright = "\x1b[1m"
const Dim = "\x1b[2m"
const Underscore = "\x1b[4m"
const Blink = "\x1b[5m"
const Reverse = "\x1b[7m"
const Hidden = "\x1b[8m"
const FgBlack = "\x1b[30m"
const FgRed = "\x1b[31m"
@ferrwan
ferrwan / problems-answers-link.md
Last active October 31, 2021 09:32
Collection of my problems' answers that sometime might be reuse.
@ferrwan
ferrwan / clone.js
Created June 6, 2019 22:22
For cloning from an instance so its value isn't by reference
// Some util
const getType = source =>
({}.toString
.call(source)
.match(/\s([a-zA-Z]+)/)[1]
.toLowerCase());
const isObject = source => getType(source) === 'object'
const isArray = source => getType(source) === 'array'
// Dummy
@ferrwan
ferrwan / .tmux.conf
Last active October 21, 2020 11:00
tmux config
# set -g default-terminal "tmux-256color"
# set -g default-terminal "xterm-256color"
set -g default-terminal "screen-256color"
set-option -sa terminal-overrides ',xterm-256color:RGB'
set -g prefix C-q
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
@ferrwan
ferrwan / .nvimrc
Last active February 25, 2022 19:36
My neovim setup
""""""""""""""""""""""""""""""""""""""""
" vim-plug
""""""""""""""""""""""""""""""""""""""""
call plug#begin('~/.vim/plugged')
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'scrooloose/nerdtree'