Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am kevinschoon on github.
* I am kevinschoon (https://keybase.io/kevinschoon) on keybase.
* I have a public key ASBAoAt5MndM6xvjPJlKn7zt20wURtpeyDdxc9tEch4Xigo
To claim this, I am signing this object:
@kevinschoon
kevinschoon / iteration.go
Last active February 19, 2016 22:06
search test
package main
import (
"fmt"
"io/ioutil"
"math/rand"
"strings"
"time"
)
@kevinschoon
kevinschoon / routines.go
Last active February 19, 2016 22:01
Demonstration of concurrency using Go routines with shared lock plus error and signal handling.
/*
Demonstration of concurrency using Go routines with shared lock plus error and signal handling.
*/
package main
import (
"fmt"
"io/ioutil"
"math/rand"
"os"
@kevinschoon
kevinschoon / recurse.py
Last active January 8, 2016 13:25
recurse
import sys
def recurse(count=0):
count += 1
if count + 2 < sys.getrecursionlimit():
recurse(count)
else:
answer = raw_input("YOU HAVE REACHED {} DO YOU DARE TO CONTINUE?! [yes/no/whatev]: ".format(count))
if answer == "yes":
@kevinschoon
kevinschoon / gist:8176565
Created December 30, 2013 00:47
Extract Cloudfront log data with Logstash
filter {
if [type] == "cloudfront" {
csv {
separator => " "
columns => [ "date", "time", "x-edge-location", "sc-bytes", "c-ip", "cs-method", "Host", "cs-uri-stem", "sc-status", "Referer", "User-Agent", "cs-uri-query", "Cookie", "x-edge-result-type", "x-edge-request-id", "x-host-header", "cs-protocol", "cs-bytes" ]
add_field => [ "listener_timestamp", "%{date} %{time}" ]
}
date {
type => "cloudfront"
@kevinschoon
kevinschoon / example.js
Created September 17, 2013 21:56
Welcome to your first Gist! Gists are simple code reminders. Whenever you come across a piece of code you think might be useful later on, save it as a Gist. With GistBox, you can also tag the Gist with a label. This is especially useful for keeping them organized by language, project or purpose. For more info about GistBox, visit: http://www.gi…
// log an object to the browser console
console.log({ text: "foobar" });
@kevinschoon
kevinschoon / main.go
Last active November 20, 2015 00:45
Random Cron Scheduler
package main
import (
"fmt"
"time"
"math/rand"
"bytes"
"gopkg.in/robfig/cron.v2"
)
@kevinschoon
kevinschoon / recurse.py
Created September 13, 2015 20:50
Recursive Dropbox API Call
class FileObject:
def __init__(name, **kwargs):
self.name = name
def get_metadata(path):
resp = client.metadata(path)
for f in resp['contents']:
if f['is_file']:
yield FileObject(**f)
else:
#!/usr/bin/env python
"""
Convert YAML to JSON and JSON to YAML
"""
import yaml
import json
import sys

CI Example

This is a very simplified and hypothetical example of a continuous integration / delivery system.

Major components

  • Apache Mesos cluster configured with a master/slave setup.
  • Marathon Mesosphere's Marathon framework running on Apache Mesos.