Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan Brink jonbri

View GitHub Profile
@jonbri
jonbri / install-node.sh
Created Jun 14, 2019
install node as a one-liner
View install-node.sh
sudo apt-get update && sudo apt-get install -y curl && sudo curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - && sudo apt-get install -y nodejs
@jonbri
jonbri / FormatSwitch.vim
Created Dec 12, 2017
Switch statement formatting
View FormatSwitch.vim
function! FormatSwitch()
:normal j
:normal vi}>
:write
endfunction
nnoremap <silent> <Plug>FormatSwitchPlug :call FormatSwitch()<CR>
\:call repeat#set("\<Plug>FormatSwitchPlug")<CR>
nmap cFS <Plug>FormatSwitchPlug
@jonbri
jonbri / vaderTemplate.vim
Created Nov 15, 2017
Blank template for VimScript/Vader testing
View vaderTemplate.vim
" Blank template for Vader testing
" Invoke with `:Vader`
" Resources:
" https://github.com/junegunn/vader.vim
" https://junegunn.kr/2013/10/testing-vimscript-with-vader-vim
Before;
function! FooBecomesBar()
:silent! %s/foo/bar/
endfunction
@jonbri
jonbri / playAudio.js
Created Apr 26, 2017
NodeJS: play audio file
View playAudio.js
var player = require('play-sound')(opts = {});
var sFile = 'hello.wav';
// access the node child_process in case you need to kill it on demand
var audio = player.play(sFile, function(err) {
if (err && !err.killed) throw err
});
setTimeout(function() {
View installDocker_xenial.sh
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
sudo apt-get update
apt-cache policy docker-engine
sudo apt-get install -y docker-engine
sudo systemctl status docker
@jonbri
jonbri / installNodeJS_xenial.sh
Created Jan 11, 2017
Install NodeJS on Xenial
View installNodeJS_xenial.sh
apt-get update && apt-get install -y curl \
&& curl -sL https://deb.nodesource.com/setup_7.x | bash - \
&& apt-get install -y nodejs