This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'json' | |
| if ARGV.length < 3 then | |
| puts "Usage: squirt <filename> <channel> <comment>" | |
| exit | |
| end | |
| token = "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)!" | |
| */ |