Skip to content

Instantly share code, notes, and snippets.

View anxiousmodernman's full-sized avatar
🎺
ready for a ska revival

Coleman McFarland anxiousmodernman

🎺
ready for a ska revival
View GitHub Profile
@anxiousmodernman
anxiousmodernman / Vagrantfile
Created February 15, 2017 16:02
Make a Centos box
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@anxiousmodernman
anxiousmodernman / terraform-error-1481165731.log
Created December 8, 2016 03:02
terraform-error-1481165731.log
5 error(s) occurred:
* plan operation: Real and shadow states do not match! Real state:
<no state>
module.child:
<no state>
Outputs:
received = 1GB
@anxiousmodernman
anxiousmodernman / CONTRIBUTING.md
Last active August 15, 2021 08:28
CONTRIBUTING.md

Code Quality and Contribution Guidelines

Tests

Code should be submitted with a reasonable suite of tests, and code should be designed with testability in mind.

Commit Messages

Commit messages should explain why code is changing, configuration is added,

@anxiousmodernman
anxiousmodernman / REQUIREMENTS.md
Last active December 2, 2016 14:49
Golang coding demonstration

Go(lang) Coding Demonstration

Supply buildable source code that runs as a simple webserver.

The webserver is for storing clients' favorite foods. It should expose two API operations:

  • GET on a route "/foods" to return a list of all your favorite foods
  • POST on the same route "/foods" to add a food to the list
@anxiousmodernman
anxiousmodernman / send.go
Last active November 22, 2016 23:44
Good one to study
import (
"errors"
"log"
"net/http"
"time"
"flag"
"fmt"
)
var (
@anxiousmodernman
anxiousmodernman / zk_test.go
Created November 7, 2016 18:51
ZK connection keepalive demonstartion
package kafka
import (
"testing"
"time"
"github.com/samuel/go-zookeeper/zk"
)
func TestDiscoverKafka(t *testing.T) {
#!/bin/bash
mkdir -p $HOME/.terminal-slack
(
cd $HOME/.terminal-slack
git clone https://github.com/evanyeung/terminal-slack > /dev/null
cat > terminal-slack.sh << EOF
#!/usr/bin/python3
if __name__ == '__main__':
print('hello world')
@anxiousmodernman
anxiousmodernman / http_helpers.go
Created August 31, 2016 03:11
Sick HTTP helpers in Go
import (
"encoding/json"
"log"
"net"
"net/http"
"os"
"gopkg.in/mgo.v2"
"github.com/rs/cors"
@anxiousmodernman
anxiousmodernman / helpers.rs
Created July 24, 2016 14:09
Trouble understanding lifetimes
extern crate yaml_rust;
use std::fs::File;
use std::io;
use std::io::prelude::*;
use std::process;
// NOTE: why self here, again?
// because `use` defaults from crate root, and yaml is beneath
// crate root