Skip to content

Instantly share code, notes, and snippets.

Matt Brown mattnworb

Block or report user

Report or block mattnworb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View addresses.txt
num_addresses
0 437
1 586
2 689
3 212
4 39
5 28
6 15
7 10
8 26
View gist:327d9388a4ab687e72f55f959e121e07
$ TF_LOG=trace terraform init
2019/07/29 13:31:41 [INFO] Terraform version: 0.12.5
2019/07/29 13:31:41 [INFO] Go runtime version: go1.12.4
2019/07/29 13:31:41 [INFO] CLI args: []string{"/usr/local/Cellar/tfenv/1.0.1/versions/0.12.5/terraform", "init"}
2019/07/29 13:31:41 [DEBUG] Attempting to open CLI config file: /Users/mattbrown/.terraformrc
2019/07/29 13:31:41 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/07/29 13:31:41 [INFO] CLI command args: []string{"init"}
2019/07/29 13:31:41 [TRACE] ModuleInstaller: installing child modules for . into .terraform/modules
Initializing modules...
2019/07/29 13:31:41 [DEBUG] Module installer: begin asia-east1-REDACTED
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:

@mattnworb
mattnworb / Vagrantfile
Created Apr 7, 2014
Sample Vagrantfile to run MySQL on a centos vm
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
}
@mattnworb
mattnworb / print_times.coffee
Created Feb 17, 2012
Loops over a file containing one JSON entry per line and prints out the created_at value . This gist shows the original coffeescript and the generated JavaScript
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)
@mattnworb
mattnworb / gist:1405216
Created Nov 29, 2011
error in Octave using mean on binary vector
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 =
You can’t perform that action at this time.