Skip to content

Instantly share code, notes, and snippets.

View alexblackie's full-sized avatar

Alex Blackie alexblackie

View GitHub Profile
@alexblackie
alexblackie / jellybeans.ini
Created January 28, 2016 06:14
Gnome Terminal profile for jellybeans
# dconf dump /org/gnome/terminal/legacy/profiles:/
[:b1dcc9dd-5262-4d8d-a863-c897e6d979b9]
foreground-color='rgb(173,173,173)'
visible-name='Jellybeans'
login-shell=true
palette=['rgb(59,59,59)', 'rgb(207,106,76)', 'rgb(153,173,106)', 'rgb(216,173,76)', 'rgb(89,123,197)', 'rgb(160,55,176)', 'rgb(113,185,248)', 'rgb(173,173,173)', 'rgb(99,99,99)', 'rgb(247,146,116)', 'rgb(193,213,146)', 'rgb(255,213,116)', 'rgb(129,163,237)', 'rgb(200,95,216)', 'rgb(153,225,255)', 'rgb(213,213,213)']
default-size-rows=45
default-size-columns=160
use-system-font=false
use-theme-colors=false
@alexblackie
alexblackie / to_scss.sh
Created November 8, 2015 22:56
Convert all `.sass` into `.scss` in a specified directory.
bundle exec sass-convert -F sass -T scss -R -i source/stylesheets && rename .sass .scss source/stylesheets/**/*
@alexblackie
alexblackie / pivotal_deliverance.rb
Created November 3, 2015 20:46
Meant to be run in a Jenkins job; marks stories in Pivotal as "Delivered" if their IDs are mentioned in a commit that's part of the current Jenkins build changeset.
require "net/http"
require "json"
require "pry"
# Wrapper around the Jenkins JSON API
class Jenkins
# @param [string] jenkins_user - a Jenkins user with at least read access
# @param [string] token - Jenkins API token for the user
# @param [string] job - Jenkins job name
def initialize(jenkins_user, token, job)
@alexblackie
alexblackie / xdg.sh
Created November 1, 2015 01:57
Set firefox as default browser on linux
# Set Firefox to be default browser on non-desktop-environmented Linux
xdg-mime default firefox.desktop 'x-scheme-handler/http'
xdg-mime default firefox.desktop 'x-scheme-handler/https'
@alexblackie
alexblackie / backup.sh
Last active September 13, 2015 22:11
Super simple rsync-powered backup script
#!/bin/sh
# BLACKIEOPS SUPER LEGIT BACKUP SOLUTION (TM)
#
# - rsync's a few directories to a specified path (hopefully a remote NFS
# mount or something)
# - Keeps only the last two weeks of backups.
run () {
MOUNT=/backup/contents/$(hostname)
diff --git a/usr/bin/xdg-open.orig b/usr/bin/xdg-open
index 7218fee..53cd90a 100755
--- a/usr/bin/xdg-open.orig
+++ b/usr/bin/xdg-open
@@ -643,7 +643,7 @@ search_desktop_file()
args=$(( $args - 1 ))
done
[ $replaced -eq 1 ] || set -- "$@" "$target"
- "$command_exec" "$@"
+ eval $("$command_exec" "$@")
-module(example_gs).
-behaviour(gen_server).
-export([start_link/0, init/1]).
-export([handle_call/3, handle_cast/2, handle_info/2]).
-export([code_change/3, terminate/2]).
start_link() ->
gen_server:start_link(?MODULE, [], []).
@alexblackie
alexblackie / lol_ubuntu.sh
Last active September 7, 2015 23:19
First step after installing Ubuntu (14.04)
sudo apt-get remove -y unity-scope-virtualbox unity-scope-yelp unity-scope-zotero unity-scope-texdoc unity-scope-tomboy unity-scope-video-remote unity-scope-musicstores unity-scope-musique unity-scope-openclipart unity-scope-manpages unity-scope-guayadeque unity-scope-gdrive unity-scope-gmusicbrowser unity-scope-gourmet unity-scope-colourlovers unity-scope-devhelp unity-scope-firefoxbookmarks unity-scope-chromiumbookmarks unity-scope-clementine unity-lens-friends unity-scope-audacious unity-scope-calculator account-plugin-aim account-plugin-jabber account-plugin-salut account-plugin-yahoo account-plugin-twitter account-plugin-windows-live account-plugin-flickr account-plugin-google account-plugin-facebook && \
sudo apt-get update && \
sudo apt-get dist-upgrade -y && \
sudo apt-get install -y zsh vim tmux git pass virtualbox gnome-tweak-tool rxvt-unicode xclip nodejs-legacy libxslt-dev libxml2-dev openssh-server
@alexblackie
alexblackie / vagrant_function.sh
Created July 25, 2014 20:55
Run commands inside a Vagrant box with as little effort as possible.
# Put this your shellrc file (`.bashrc`, `.zshrc`, etc)
vs() {
args=$(printf "%s " "$@") # concatenate arguments into single string
vagrant ssh -c "$args"
}
@alexblackie
alexblackie / alexblackie.man
Last active December 3, 2015 18:16
% man alexblackie
ALEX(8) World Wide Web Person Manual ALEX(8)
NAME
Alex Blackie -- web developer at MetaLab
USAGE
twitter(1) - @alexblackie
email(1) - alex@alexblackie.com
gpg(1) - http://pgp.mit.edu/pks/lookup?op=get&search=0xF6AA8E960D9F7F9F
ssh(1) - http://key.alexblackie.com/