Skip to content

Instantly share code, notes, and snippets.


Jamie Schembri shkm

View GitHub Profile
shkm / dcsh
Created Aug 27, 2021
dcsh: Shell into docker container
View dcsh
#!/usr/bin/env bash
# Tries to open a shell in the main docker container (e.g. it ends in 'app' or 'api')
# Given a param, uses that as a pattern to look for at the end of the container name.
# Usage:
# dcsh <container_pattern>
set -o errexit # Exit on most errors (see the manual)
View gist:515e278d0bd56d042d50eb7167464c25
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="">
<title>Example Feed</title>
<link href=""/>
<name>John Doe</name>
View gist:3153a99a6208e6cbdea4f4a530dde36a
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="">
<title>Example Feed</title>
<link href=""/>
<name>John Doe</name>
shkm / rvm
Created Oct 17, 2016
RVM for fish. Taken from for easy use with fisherman.
View rvm
function rvm --description='Ruby enVironment Manager'
# run RVM and capture the resulting environment
set --local env_file (mktemp -t
bash -c 'source ~/.rvm/scripts/rvm; rvm "$@"; status=$?; env > "$0"; exit $status' $env_file $argv
# apply rvm_* and *PATH variables from the captured environment
and eval (grep '^rvm\|^[^=]*PATH\|^GEM_HOME' $env_file | grep -v '_clr=' | sed '/^[^=]*PATH/s/:/" "/g; s/^/set -xg /; s/=/ "/; s/$/" ;/; s/(//; s/)//')
# needed under fish >= 2.2.0
and set -xg GEM_PATH (echo $GEM_PATH | sed 's/ /:/g')
shkm / raboparser.rb
Last active Feb 29, 2016
Quick 'n dirty Rabobank CSV export parser, parsing into a format that can easily be read by GnuCash.
View raboparser.rb
#!/usr/bin/env ruby
# Parses Rabobank's CSV export into a CSV format more readable by GnuCash.
# To import, use the following settings:
# Start import on row: 2
# Separators: Semicolon
# Date format: y-m-d
# Currency format: Period
shkm /
Last active Aug 27, 2015
Sets up some tmux basics.



M-\ -- Horizontal split
M-| -- Vertical split
M-= -- Even out splits horizontally
M-+ -- Even out splits vertically
C-h -- Move to left split
C-j -- Move to lower split
C-k -- Move to upper split

shkm / .zshrc
Last active Aug 29, 2015
Suspend or halt all running Vagrant boxes.
View .zshrc
# Suspend
vsall() {
vagrant global-status --prune | grep running | awk '{system("vagrant suspend "$1)}'
# Halt
vhall() {
vagrant global-status --prune | grep running | awk '{system("vagrant halt "$1)}'
shkm / CSGO Scripts
Last active Aug 29, 2015
Quick and dirty AHK scripts to set monitor preferences and toggle Dolby audio (for virtual surround sound). Assumes multiple monitors, Display Color being pinned as the first item.
We couldn’t find that file to show.
shkm / some_spec.rb
Created Sep 12, 2014
Get text of the main describe block in RSpec. Useful for rendering views with locals.
View some_spec.rb
describe 'shared/some_partial.html.erb' do
before(:all) { layout = self.class.metadata[:description] }
# ...
shkm / private.xml
Last active Aug 29, 2015
Hook up MPD (MPC) to work with the CM Storm Ninja (And Filcos?) in Karabiner.
View private.xml
<?xml version="1.0"?>
<url type="shell">
if $MPC status | grep -q 'playing'