Skip to content

Instantly share code, notes, and snippets.

View jonbri's full-sized avatar

Jonathan Brink jonbri

View GitHub Profile
@jonbri
jonbri / installNodeJS_xenial.sh
Created January 11, 2017 17:55
Install NodeJS on Xenial
apt-get update && apt-get install -y curl \
&& curl -sL https://deb.nodesource.com/setup_7.x | bash - \
&& apt-get install -y nodejs
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 / playAudio.js
Created April 26, 2017 01:11
NodeJS: play audio file
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() {
@jonbri
jonbri / vaderTemplate.vim
Created November 15, 2017 17:18
Blank template for VimScript/Vader testing
" 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 / FormatSwitch.vim
Created December 12, 2017 18:31
Switch statement formatting
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 / install-node.sh
Created June 14, 2019 14:45
install node as a one-liner
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