This file contains 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
### 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: |
This file has been truncated, but you can view the full file.
This file contains 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
[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 |
This file contains 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
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( |
This file contains 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
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)) |
This file contains 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
val actorList = Vector.fill(actorPoolSize)(airbrakeActor) | |
def airbrakeActor: Actor[() => Validation[Throwable, Int]] = { | |
actor(doNotify) | |
} | |
def doNotify(f: () => Validation[Throwable, Int]) { | |
f() | |
} |
This file contains 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
def notifySync(notice: AirbrakeNotice): Validation[Throwable, Int] = { | |
notify(prepareRequest(notice)).unsafePerformIO | |
} | |
def notify(xml: NodeSeq): IO[Validation[Throwable, Int]] = { | |
sendNotification(xml).map(_.success[Throwable]).except(_.fail[Int].pure[IO]) | |
} | |
def sendNotification(xml: NodeSeq): IO[Int] = io { | |
. . . |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.yourdomain</groupId> | |
<artifactId>yourdomain</artifactId> | |
<packaging>jar</packaging> | |
<name>YourName</name> |
This file contains 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
package sugar | |
import org.slf4j.{Logger, LoggerFactory} | |
trait LoggingSugar { | |
/** | |
* This is just a convenience method so you can type: | |
* | |
* getLogger[Foo] |
This file contains 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
object FizzBuzz { | |
def main(args: Array[String]) { | |
for (i <- 1 to 100) { | |
(i % 3, i % 5) match { | |
case (0, 0) => println("FizzBuzz") | |
case (0, _) => println("Fizz") | |
case (_, 0) => println("Buzz") | |
case _ => println(i) | |
} | |
} |
This file contains 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
public class Spiral { | |
public static void main(String[] args) { | |
int row = Integer.parseInt(args[0]); | |
int col = Integer.parseInt(args[1]); | |
int[][] matrix = new int[row][col]; | |
for (int i = 0; i < row; i++) { | |
for (int j = 0; j < col; j++) { | |
matrix[i][j] = i * col + j + 1; |
NewerOlder