Skip to content

Instantly share code, notes, and snippets.

@taylorleese
taylorleese / gist:2870730
Created June 4, 2012 20:37
Airbrake Example Actor Setup
val actorList = Vector.fill(actorPoolSize)(airbrakeActor)
def airbrakeActor: Actor[() => Validation[Throwable, Int]] = {
actor(doNotify)
}
def doNotify(f: () => Validation[Throwable, Int]) {
f()
}
@taylorleese
taylorleese / gist:2870739
Created June 4, 2012 20:39
Airbrake Example Actor Usage
def notifyAsync(notice: AirbrakeNotice) {
submitAsync(() => notify(prepareRequest(notice)).unsafePerformIO)
}
def submitAsync(f: () => Validation[Throwable, Int]) {
getRandomActor(f)
}
def getRandomActor: Actor[() => Validation[Throwable, Int]] = {
actorList(random.nextInt(actorList.length))
@taylorleese
taylorleese / gist:2958236
Created June 20, 2012 05:09
squeryl_exception
object TestSchema extends Schema {
val applicationsTable = table[Application]("applications")
val clientsTable = table[Client]("clients")
val proxyConfigsTable = table[ProxyConfig]("proxy_configs")
val clientWithApplications = oneToManyRelation(clientsTable, applicationsTable).via((c, a) => c.id === a.clientId)
val applicationWithProxyConfigs = oneToManyRelation(applicationsTable, proxyConfigsTable).via((a, h) => a.id === h.appId)
on(applicationsTable)(t => declare(
@taylorleese
taylorleese / migrate.gemset.default.log
Created July 7, 2014 16:40
Error migrating gems.
This file has been truncated, but you can view the full file.
[2014-07-07 01:47:51] __migrate_gemset
__migrate_gemset ()
{
\mkdir -p "${rvm_gems_path:-"$rvm_path/gems"}/$2"/ && \rm -rfv "${rvm_gems_path:-"$rvm_path/gems"}/$2"/* && \cp -rv "${rvm_gems_path:-"$rvm_path/gems"}/$1"/* "${rvm_gems_path:-"$rvm_path/gems"}/$2"/ && gemset_reset_env "$2"
}
current path: /Users/taylor/code/askdavinci/puppet
GEM_HOME=/Users/taylor/.rvm/gems/ruby-1.9.3-p194
PATH=/Users/taylor/.rvm/gems/ruby-1.9.3-p194/bin:/Users/taylor/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/taylor/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/taylor/.rvm/bin:/usr/local/share/python:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/taylor/bin
GEM_PATH=/Users/taylor/.rvm/gems/ruby-1.9.3-p194:/Users/taylor/.rvm/gems/ruby-1.9.3-p194@global
command(3): __migrate_gemset ruby-1.9.3-p194 ruby-1.9.3-p547
@taylorleese
taylorleese / keybase.io - ttl
Created February 9, 2017 18:46
keybase.io - ttl
### Keybase proof
I hereby claim:
* I am taylorleese on github.
* I am ttl (https://keybase.io/ttl) on keybase.
* I have a public key ASD9ZjKFWnDqwlCkmbTpScLYBAB2NutroUiIyNoRQcMnHgo
To claim this, I am signing this object: