Skip to content

Instantly share code, notes, and snippets.

View agocs's full-sized avatar

Christopher Agocs agocs

View GitHub Profile
@agocs
agocs / diagnostics.md
Last active January 22, 2018 20:43
Diagnostics Box Checklist

Diagnostics Box Checklist

Goals

  • Send this box to Copernicus's next port
  • Have crew plug it in while Copernicus is at port
  • Connect to local cell network & phone home
  • Automatically SSH into Autologger and run some automated tests
@agocs
agocs / docker-compose.yml
Created November 15, 2017 19:29
LogDNA docker-compose
#Set the following env vars when you run docker-compose
# - INGESTION_KEY=the LogDNA ingestion key
# - APP_ENVIRONMENT=dev or qa or prod
# - LOGDNA_PORT= the logdna port you've created for Logspout
# Largely lifted from https://github.com/gliderlabs/logspout#using-logspout-in-a-swarm
version: "3"
services:
logspout:
@agocs
agocs / consumer.go
Last active April 19, 2017 22:45
Bob's RabbitMQ Example
package main
import (
"log"
"os"
"os/signal"
"github.com/streadway/amqp"
)
@agocs
agocs / get_data.sh
Last active February 24, 2017 18:40
Experimental_traceback analysis
#First, you want to enable `experimental_traceback` in Django Admin's Experimental Features.
#Let some data collect in influx.
wget -O data.json https://influxdb-dramafever.drama9.com:8443/query?q=select+*+from+short_term.experimental_traceback%3B&db=appmetrics
#now we have a big JSON object containing 10,000 rows of experimental_traceback data from Influx.
python processIndivLines.py | sort -r -n
#This finds the interesting lines from the database, counts how often they're used, and spits out sorted csv output.
@agocs
agocs / nightlight.ino
Created January 29, 2017 20:11
Arduino powered nightlight
void setup() {
// put your setup code here, to run once:
Serial.begin(9600); // Here, we're initializing communication from the arduino back to the computer
pinMode(3,OUTPUT); // Here, we're setting pin D3 as an output pin.
}
void loop() {
// put your main code here, to run repeatedly:
int sensorValue = analogRead(A2); // Reading the photosensor
@agocs
agocs / pollmole.md
Created October 20, 2016 01:39
Poll Mole

Original Facebook Post

All Trump supporters please read!! And SHARE!!!! We need to reach billions!

Please spread the word about the Poll Mole app pending patent that was released a few days ago - the goal is to have at least 20 million voters use this app for polling, particularly on the exit poll on election day nov 8 - you vote for your candidate and your vote is registered in the cloud, and the votes are tracked by the Poll Mole system - it has been stressed tested by killer bees and the app withstood the stress test - it detects election fraud 99.98%, it is hack proof, it is crash proof - its purpose is to circumvent the news media and globalist agenda to steal the election - it canvases all 180,000 precincts in the US in real-time, 24/7 - read the FAQ and dr richard davis, inventor explains how the media is skimming the election - if election fraud is detected, the fraudulent activity can be reported by poll mole through its technology that counts each vote in the exit poll as an

Let's begin with the assumption that, at any given time, there are a finite number of people seeking a job. Each person only spends a finite amount of time seeking a job. Let's call this set of people S (for Seeking), where S is a subset of all living humans.

Let's say you're hiring for a specific position, e.g. Font End Developer. You don't want to accept resumes from short order cooks or airline pilots or geneticists, you only want resumes from people who are (or can quickly become) front end developers. Let's call this set P, again, a subset of all living humans.

Finally, you only want people who live in, or are willing to relocate to, a certain location e.g. Tampa. We'll call this L, again, a subset of all living humans.

Let's also accept that there is a cost associated with not hiring, i.e. the longer you wait, the more your business suffers for lack of a front end developer.

You can collect a bunch of resumes, and order them for fitness in a relatively short period of time (here we're ass

@agocs
agocs / foo.go
Created May 18, 2016 18:08
Is it faster to append, or to just assign in place?
package main
var sliceOf20Ints = []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
func toIfaceWithAppend(ints []int) []interface{} {
var ifaceInts = make([]interface{}, 0, len(ints))
for _, someInt := range ints {
ifaceInts = append(ifaceInts, someInt)
}
return ifaceInts
@agocs
agocs / BURGIN.md
Last active May 12, 2016 20:10
MAKIN BURGERS

Burgers Sous Vide

Ingredients

  • 2-ish lbs Ground beef: Alton Brown calls for equal portions ground chuck and ground sirloin. If I'm feeling lazy, I'll just pull two bricks of Costco frozen organic ground beef out of the freezer and call it good.
  • Spices. Pick one or more of the following
    • Salt
  • Montreal Steak Seasoning
package main
import (
"encoding/json"
"io"
)
type Hacker struct {
Name string
Plan string
}