This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// run in terminal with: node woop-woop.js [arraySize = 1000000] [runs = 1] | |
// e.g. `node woop-woop.js 1000 2` runs the benchmark twice with thousand users. | |
const runs = parseInt(process.argv[3] || 1); | |
const arraySize = parseInt(process.argv[2] || 1000000); | |
let usersToGiveCoins = Array(arraySize).fill({username: 'Koala', coins: 0}); | |
// simple benchmark function to wrap time + timeEnd and | |
// allows running benchmark an arbitrary number of times. | |
function bench(label, fn, times = 1) { | |
for (let i = 0; i < times; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" FZF.vim now supports this command out of the box | |
" so this code is no longer needed. | |
command! -bang -nargs=* Rg | |
\ call fzf#vim#grep( | |
\ 'rg --column --line-number --hidden --ignore-case --no-heading --color=always '.shellescape(<q-args>), 1, | |
\ <bang>0 ? fzf#vim#with_preview({'options': '--delimiter : --nth 4..'}, 'up:60%') | |
\ : fzf#vim#with_preview({'options': '--delimiter : --nth 4..'}, 'right:50%:hidden', '?'), | |
\ <bang>0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isObject = subject => subject !== null && typeof subject === 'object'; | |
const b = block => { | |
return { | |
// store values in underscored variable names since | |
// normal names will be used for functions | |
__block: block, | |
__element: null, | |
__modifiers: [], | |
// clear element and modifier cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" since it is fullscreen, I'd like a 50/50 split | |
let g:codi#width = 50.0 | |
" instead of destroying buffers, hide them and | |
" index them by filetype into this dictionary | |
let s:codi_filetype_tabs = {} | |
fun! s:FullscreenScratch() | |
" store filetype and bufnr of current buffer | |
" for later reference |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" since it is fullscreen, I'd like a 50/50 split | |
let g:codi#width = 50.0 | |
fun! s:FullscreenScratch() | |
" store filetype and bufnr of current buffer | |
" for later reference | |
let current_buf_ft = &ft | |
let current_buf_num = bufnr('%') | |
" create a new empty tab and set it up |