Skip to content

Instantly share code, notes, and snippets.

View mattfreer's full-sized avatar

Matt Freer mattfreer

View GitHub Profile
@d11wtq
d11wtq / docker-ssh-forward.bash
Created January 29, 2014 23:32
How to SSH agent forward into a docker container
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash
@jon
jon / Solarized Dark (Sierra).terminal
Created April 22, 2017 17:02
Solarized Dark Theme with sRGB Colors for OS X Sierra
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPECkwLjAyNzQ1MDk4
MDM5IDAuMjExNzY0NzA1OSAwLjI1ODgyMzUyOTQgMU8QJzAuMDM5MzgwNzM2NjUgMC4x
@sfate
sfate / gist:6411512
Created September 2, 2013 10:35
String interpolation in ruby style
String.prototype.format = function() {
var i = -1, args = arguments;
return this.replace(/#\{(.*?)\}/g, function(one, two) {
return (typeof args[0] == 'object')?args[0][two]:args[++i];
});
}
console.log("#{value}".format({value: "howdy, #{username}".format('sfate')}))
@xmcgyver
xmcgyver / vimp.sh
Created September 1, 2010 09:18
vimp = vi + pimp (allows vi to open a file from a grep search at the specified line number from the search result)
#!/bin/bash
# vimp = vi + pimp (allows vi to open a file from a grep search at the specified line number from the search result)
# (example usage -> prompt$ vimp /etc/hosts:23)
# tested on OS X 10.6 only
x="$1"
y=`basename $1`
# if colon in param
if [[ $y == *:* ]]