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 / doing_a_build_involving_npm.sh
Last active December 3, 2015 03:37
Is this a good idea
npm_install()
{
cd $PROJECT_HOME # package.json in here
if npm install
then
return 0
else
@anxiousmodernman
anxiousmodernman / openssl_conn.go
Created February 5, 2016 17:54
golang openssl example
// NewOpenSSLTransport returns a TCP connection establish with OpenSSL.
func NewOpenSSLTransport(trustPath, certPath, keyPath, host, port string, dialOpts *OpenSSLDialOptions) (*openssl.Conn, error) {
// Default to flag 0
if dialOpts == nil {
dialOpts = &OpenSSLDialOptions{}
}
ctx, err := openssl.NewCtx()
if err != nil {
@anxiousmodernman
anxiousmodernman / cookie_jar_golang.go
Created March 13, 2016 17:51 — forked from varver/cookie_jar_golang.go
Login to a website with this golang code using persistent cookies or cookie jar .
@anxiousmodernman
anxiousmodernman / containers.sls
Last active July 8, 2016 18:24
How to configure Docker Hub
deciphernow/odrive:latest:
dockerng.image_present:
- insecure_registry: True
- name: deciphernow/odrive:latest
@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
@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"
#!/usr/bin/python3
if __name__ == '__main__':
print('hello world')
#!/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
@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) {
@anxiousmodernman
anxiousmodernman / send.go
Last active November 22, 2016 23:44
Good one to study
import (
"errors"
"log"
"net/http"
"time"
"flag"
"fmt"
)
var (