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
# Generates commands to track days since an event | |
# | |
# it's been <number> days since <event> - Set the day when the event happened | |
# <event> on <date> - Set the date the event happened (yyyy-mm-dd) | |
# how long since <event>? - Display the number of days since the event | |
module.exports = (robot) -> | |
robot.respond /(.*?) on ((19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01]))/, (msg) -> | |
event = msg.match[1] | |
date = new Date(msg.match[2]) |
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
# Generates commands to track days since an event | |
# | |
# it's been <number> days since <event> - Set the day when the event happened | |
# how long since <event>? - Display the number of days since the event | |
module.exports = (robot) -> | |
robot.respond /it's been (\d+) days since\s+(.*?)[.?!]?$/i, (msg) -> | |
date = new Date | |
date.setTime(date.getTime() - (parseInt(msg.match[1])*1000*24*60*60)) | |
robot.brain.data.days_since ||= {} |
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 -rubygems | |
require 'faraday' | |
require 'trollop' | |
require 'fileutils' | |
class ZenDesk2Tender | |
include FileUtils | |
attr_reader :opts, :conn | |
EXPORT_DIR = '.export-data' |
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
var fs = require("fs"), | |
sys = require("sys"), | |
path = require("path"); | |
exports.MIME_TYPES = { | |
".txt" : "text/plain", | |
".html" : "text/html", | |
".css" : "text/css", | |
".js" : "application/x-javascript", | |
".manifest" : "text/cache-manifest" |
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
var TwitterNode = require( 'twitter-node' ).TwitterNode, | |
sys = require( 'sys' ) | |
var keywords = process.ARGV.slice(2), | |
twit = new TwitterNode({ | |
user: 'LOGIN', | |
password: 'PASSWORD', | |
track: keywords | |
}) |
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
/** | |
* discount.ooc | |
* copyright 2010 Zack Hobson <[email protected]> | |
* | |
* This is an interface to the discount markdown library in the ooc | |
* programming language. | |
* | |
* http://www.pell.portland.or.us/~orc/Code/markdown/ | |
* http://ooc-lang.org/ | |
* |
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
# example of a method definition with a name that isn't an identifier | |
x = :'this is some crazy a$$ shit!' | |
self.class.send(:define_method, x) do | |
puts 'crazy!' | |
end | |
send x |
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
namespace :remote do | |
desc "Open a screen on the deploy target server." | |
task :screen do | |
system "ssh -t #{user}@#{server_name} screen" | |
end | |
end | |
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
# Attempt to extract the currently running revision number. | |
# In production mode, attempts to use the Capistrano REVISION file. | |
# If development mode, attempts to use the .svn/entries file, then git-svn, and finally git-describe. | |
# If a revision can't be determined, the value is 'x'. | |
REVISION = begin | |
revision_path = Rails.root + '/REVISION' | |
entries_path = '.svn/entries' | |
if ENV['RAILS_ENV'] == 'production' | |
if File.exists?(revision_path) | |
File.open(revision_path, "r") do |rev| |
NewerOlder