Skip to content

Instantly share code, notes, and snippets.

#393939,#2D2D2D,#66ACAC,#FFFFFF,#515151,#E3E0D8,#99CC99,#fb4934
@gusaiani
gusaiani / flattenArbitrarilyDeepArray.js
Last active July 4, 2018 17:09
The ES6 function below flattens an arbitrarily deep array.
function flattenArbitrarilyDeepArray(arr, cache = []) {
return arr.reduce((acc, item) => {
if (Array.isArray(item)) {
acc.concat(flattenArbitrarilyDeepArray(item, acc))
}
else acc.push(item)
return acc
}, cache)
}
@gusaiani
gusaiani / .gitignore_global
Last active July 20, 2018 20:49
My gitignore_global
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@gusaiani
gusaiani / vimium-options.json
Last active October 23, 2024 02:09
Vimium setup for Colemak keyboard
{
"settingsVersion": "1.64",
"exclusionRules": [
{
"pattern": "https?://mail.google.com/*",
"passKeys": ""
},
{
"pattern": "https?://toggl.com/*",
"passKeys": "n"

Keybase proof

I hereby claim:

  • I am gusaiani on github.
  • I am gusaiani (https://keybase.io/gusaiani) on keybase.
  • I have a public key ASC2AHkmg49Tv28OjDfSoxAthD-O7nd2RmFHmmluxB6VEwo

To claim this, I am signing this object:

@gusaiani
gusaiani / gusaiani.plugin.zsh
Last active November 17, 2022 21:53
ZSH Initializer
mkcd() {
dir="$*"
mkdir -p "$dir" && cd "$dir"
}
cpwd() {
pwd | pbcopy
}
alias gcne='git commit --amend --no-edit'
@gusaiani
gusaiani / .vimrc
Last active October 22, 2024 23:18
My .vimrc
call plug#begin('~/.vim/plugged')
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }