Skip to content

Instantly share code, notes, and snippets.

View amackworth's full-sized avatar

Alexander Mackworth Mendoza amackworth

View GitHub Profile
@foozmeat
foozmeat / squirt
Last active September 13, 2018 14:07
squirt: upload a file to a slack channel from the cli
#!/usr/bin/env ruby
require 'json'
if ARGV.length < 3 then
puts "Usage: squirt <filename> <channel> <comment>"
exit
end
token = ""
@amackworth
amackworth / tree.sh
Created November 3, 2011 19:31
A copy of the tree command on Windows to *-nix machines
find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
function t(s,d,p){for(p in d)s=s.replace(new RegExp('{'+p+'}','g'),d[p]);return s;}
/*
String templating engine:
t("Hello {name}!, It is {date}!", { name: "Thomas", date: function(){ return new Date }});
// = "Hello Thomas!, It is Sun May 08 2011 15:15:33 GMT-0400 (EDT)!"
*/