I hereby claim:
- I am timblair on github.
- I am timblair (https://keybase.io/timblair) on keybase.
- I have a public key whose fingerprint is 00B7 B4C9 C77C 3E30 F381 0B80 45B2 84B3 AC7A 6D2F
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
module.exports = function (robot) { | |
robot.hear(/ (?:is )(\w+ ?){1,6}/i, function (msg) { | |
if (Math.random() < 0.001) { | |
var match = msg.match[0].trim().replace(/^is /,""); | |
msg.send("You're " + match); | |
} | |
}); | |
}; |
require "date" | |
class MessageID | |
module Decode | |
STAMP_FIELD_FORMAT = "%Y%m%d%H%M%S%N" | |
def self.decode(id) | |
user, host = id.split("@") | |
parts = user.split(".").map { |part| part.to_i(36) } | |
stamp, ident = parts.shift, [] |
#!/usr/bin/env ruby | |
require "bunny" | |
abort "Usage: #{$0} BINDING_KEY [BINDING_KEY, ...]" if ARGV.empty? | |
conn = Bunny.new("amqp://development.vm:5672") | |
conn.start | |
channel = conn.create_channel | |
exchange = channel.exchange("event", no_declare: true) |
#!/bin/bash | |
eval "$(rbenv init -)" | |
CURRENT_RUBY=$(rbenv version-name) | |
LATEST_BUNDLER=$(curl -s https://rubygems.org/api/v1/versions/bundler/latest.json | cut -d'"' -f 4) | |
echo "Latest Bundler version: $LATEST_BUNDLER" | |
for RUBY_VERSION in $(rbenv versions --bare); do | |
rbenv shell "$RUBY_VERSION" | |
if $(gem list -i bundler); then |
var Counter = { | |
_c: {}, | |
get: function(c) { return Counter._c[c] || 0; }, | |
set: function(c, v) { Counter._c[c] = v; return v; }, | |
inc: function(c, v) { return Counter.set(c, Counter.get(c) + (v || 1)); }, | |
dec: function(c, v) { return Counter.inc(c, (v ? -v : -1)); } | |
}; | |
/** | |
* Usage: |
Pinger = function(opts) { for (var o in opts) { this.config[o] = opts[o]; } } | |
Pinger.prototype = { | |
running: false, | |
config: { | |
host : document.location.host, | |
secure : (document.location.protocol == "https:"), | |
script : '', | |
interval : 300 // interval time in seconds | |
}, | |
start: function() { this.running = true; this.schedule(); }, |
<cffunction name="myFunc"> | |
<!-- | |
What's going on here? Basically, any <cfinclude>d view files run within the scope | |
of this function, which means any variables used are effectively unscoped in terms | |
of the component. Because we're caching the view component it means we could end up | |
with nasty race conditions. By var-ing a new 'variables' scope it effectively | |
localises any variable usage (scoped or unscoped) within both the function call and | |
any included files. We also make a reference to the original (component) 'variables' | |
scope in to a new named 'scope' called 'global', so any calls to functions within |
#!/bin/bash | |
defaults write NSGlobalDomain NSUserKeyEquivalents '{"Zoom" = "@^Z"; "Zoom Window" = "@^Z"; }' |
Index: framework/Assert.cfc | |
=================================================================== | |
--- framework/Assert.cfc (revision 1148) | |
+++ framework/Assert.cfc (working copy) | |
@@ -128,21 +128,23 @@ | |
<cfargument name="expected" type="any" required="yes" hint="The expected string value" /> | |
<cfargument name="actual" type="any" required="yes" hint="The actual string value" /> | |
<cfargument name="message" required="false" default="This test failed" hint="Custom message to print in the failure." /> | |
+ <cfargument name="caseSensitive" type="boolean" required="false" default="false" hint="If set to TRUE checks the original string unaltered. Default is to check the string in lowercase" /> | |
<cfset arguments = normalizeArguments("equals",arguments)> |