View keybase.md

Keybase proof

I hereby claim:

  • I am mattnworb on github.
  • I am mattnworb (https://keybase.io/mattnworb) on keybase.
  • I have a public key ASA2R90XEzfq-WWr7zjFHZIlqA4LGdPk84bTSOt7JjgJ7wo

To claim this, I am signing this object:

View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# downloads a CentOS 6.5 base image for the VM from https://vagrantcloud.com/chef/centos-6.5
# although the box is from the people that make Chef, we use Ansible below for provisioning the VM
config.vm.box = "chef/centos-6.5"
View SearchMasterServer.scala
override def query(q: String) = {
val responses: Seq[Future[HttpResponse]] = clients.map {client => client.query(q)}
val allResponses: Future[Seq[HttpResponse]] = Future.collect(responses)
val successResponses: Future[Seq[HttpResponse]] = allResponses.map(responses => responses.filter(_.getStatus == HttpResponseStatus.OK))
successResponses.map { responses: Seq[HttpResponse] =>
if (responses.isEmpty) {
errorResponse(HttpResponseStatus.INTERNAL_SERVER_ERROR, "No successful responses")
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Service Dependencies</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src="http://underscorejs.org/underscore-min.js"></script>
<style type="text/css">
circle.node {
View Benchmark.java
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.TimeUnit;
View gist:3723290
InputStream inputstream = process.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(inputstream));
String line;
while ((line = br.readLine()) != null) {
// handle the new line of input from the process however you want
gsc.mainWindow.printf("Got another line! " + line);
// do anything else you want with the input - send it as many places as you like
}
View print_times.coffee
fs = require 'fs'
unless process.argv.length > 2
console.error "Usage: print_times <file>"
process.exit -1
fileName = process.argv[2]
String::endsWith = (ch) ->
return @length - 1 == @lastIndexOf(ch)
View gist:1405216
octave-3.4.0:1> a = [ 1 2 3 4]
a =
1 2 3 4
octave-3.4.0:2> mean(a)
ans = 2.5000
octave-3.4.0:3> b = (a == 2)
b =
View JodaTimeWeekPeriodTest.java
/**
* Code sample for http://stackoverflow.com/questions/5877226/better-way-to-check-if-a-joda-time-interval-spans-exactly-1-calendar-week-accoun
* @author: matt b
* @since: 5/4/11
*/
public class JodaTimeWeekPeriodTest {
public static void main(String[] args) {
DateTime start = new DateTime(2011, 5, 4, 0, 0, 0, 0);
View final .screenrc
screen -t 'errors'
stuff 'tail -F /var/ec/current.log | grep -A 3 "ERROR"^M'