Skip to content

Instantly share code, notes, and snippets.

View AGhost-7's full-sized avatar
🤖
Discombobulating the hive mind

Jonathan Boudreau AGhost-7

🤖
Discombobulating the hive mind
  • The land of maple syrup
View GitHub Profile
@AGhost-7
AGhost-7 / trusty-i3-install.sh
Last active October 8, 2017 21:06
Install latest i3 on ubuntu trusty
#!/usr/bin/env bash
/usr/lib/apt/apt-helper download-file http://debian.sur5r.net/i3/pool/main/s/sur5r-keyring/sur5r-keyring_2017.01.02_all.deb keyring.deb SHA256:4c3c6685b1181d83efe3a479c5ae38a2a44e23add55e16a328b8c8560bf05e5f
dpkg -i ./keyring.deb
echo "deb http://debian.sur5r.net/i3/ $(grep '^DISTRIB_CODENAME=' /etc/lsb-release | cut -f2 -d=) universe" | sudo tee /etc/apt/sources.list.d/sur5r-i3.list
sudo apt update
sudo apt install i3
git clone https://github.com/vivien/i3blocks.git
(cd i3blocks && sudo make install)
sudo apt-get install -y \
swh-plugins \
python3-dev \
python3-pip \
libgtk-3-dev \
python3-cairo-dev \
python3-numpy \
python3-scipy \
python-gi-dev \
let s:requests = {}
fu! s:chunk_handler(id, data, event)
if(!has_key(s:requests, a:id))
throw "Could not find http handler"
endif
let chunks = s:requests[a:id][a:event]
for line in a:data
call add(chunks, line)
@AGhost-7
AGhost-7 / curry.js
Last active May 23, 2017 03:41
Function currying similar to lodash's
var argCurry = function(args, n, fn) {
if(args.length === n) {
return fn.apply(null, args)
} else {
return function() {
var newArgs = args.concat(Array.prototype.slice.call(arguments))
return argCurry(newArgs, n, fn)
}
}
@AGhost-7
AGhost-7 / repo-specific-logins.sh
Created May 21, 2017 21:17
Configure git to use a different github account at the repository level
git clone [email protected]:AGhost-7/sheet-cli
cd sheet-cli
git config user.name 'AGhost-7'
git config user.email '[email protected]'
git config core.sshCommand 'ssh -i ~/.ssh/github_aghost -F /dev/null'
@AGhost-7
AGhost-7 / install-neovim.sh
Last active April 18, 2017 04:51
Install my basic neovim setup on OSX
brew install neovim
curl --create-dirs -o ~/.config/nvim/init.vim \
https://raw.githubusercontent.com/AGhost-7/dotfiles/master/init.vim
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
nvim +PlugInstall +qall
@AGhost-7
AGhost-7 / linux-overtake-osx.js
Created January 2, 2017 17:42
How long will it take for Linux desktop shares to surpass macOS? (12 months)
// data source: https://www.netmarketshare.com/operating-system-market-share.aspx?qprid=9&qpcustomb=0&qpsp=204&qpnp=13&qptimeframe=M
const osx = [7.87, 7.37, 6.92, 6.43, 6.74, 6.07]
const linux = [2.33, 2.11, 2.23, 2.18, 2.31, 2.21]
const changes = (list) => list.slice(1).map((share, i) => share - list[i])
const avg = (list) => list.reduce((accu, val) => accu + val, 0) / list.length
const linuxAvgChange = avg(changes(linux))
const osxAvgChange = avg(changes(osx))
@AGhost-7
AGhost-7 / wineasio-install.sh
Last active February 3, 2023 10:52
How to compile and install wineasio on Ubuntu Xenial 64 bit. This is for Guitar Rig only. Only works with 32 bit...
# Get the dev files for wineasio
git clone git://git.code.sf.net/p/wineasio/code /tmp/wineasio
# Install jack server
sudo apt-get install jackd1 -y
# Going to be using playonlinux to manage the wine executables but I
# still need the development files to compile wineasio
sudo apt-get install playonlinux -y
@AGhost-7
AGhost-7 / diff-logs.sh
Last active May 26, 2016 04:05
Print a diff of the commit logs *before* creating a release to generate the releases page in Jira
# The branch that the new branch hasn't been merged into
oldBranch="master"
# The branch with new commits
lastestBranch="develop"
git log $latestBranch ^$oldBranch --no-merges --pretty='format:%s' \
| grep -o -E '^(\[){0,1}([A-Za-z]+)[- ][0-9]+' \
| sed 's/\[//'