This file contains 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 wc = () => Array.from(document.querySelectorAll('.view-lines div span span')).map(e => e.innerText.split(/\s/)).flat().filter(x => /\w+/.test(x)).length | |
setInterval(() => { document.querySelector('.save-text.in-page').innerText = wc() + ' words' }, 5000) |
This file contains 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
#!/bin/bash | |
# To run like this: | |
# ./run.sh foo.py | |
# | |
# If you have `entr` installed, you can build and preview on change: | |
# ls *.py | entr -p ./run.sh /_ | |
# | |
set -e |
This file contains 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
function! CustomGoFmt() | |
let file = expand('%') | |
silent execute "!gofmt -w " . file | |
edit! | |
set filetype = go | |
endfunction | |
command! CustomGoFmt call CustomGoFmt() | |
augroup go_autocmd | |
autocmd BufWritePost *.go CustomGoFmt |
This file contains 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
" augroup reload_talk_vimrc | |
" autocmd! | |
" autocmd BufWritePost *.vimrc source ~/dev/talk.vimrc | |
" augroup END | |
" ================ General Config ================ | |
set nocompatible | |
syntax enable | |
set encoding=utf-8 |