Skip to content

Instantly share code, notes, and snippets.

Avatar

Jacob Kopczynski jkopczyn

View GitHub Profile
@jkopczyn
jkopczyn / server-example.go
Last active Aug 11, 2022
server to make datadog SubmitMetrics crash
View server-example.go
package main
import (
"github.com/sirupsen/logrus"
"net/http"
)
func serveHTTP(wr http.ResponseWriter, req *http.Request) {
http.Error(wr, "Client Error: Headers", http.StatusOK)
}
@jkopczyn
jkopczyn / submit-metrics-example.go
Last active Aug 11, 2022
datadog submit metrics to nonstandard endpoint
View submit-metrics-example.go
package main
import (
"context"
"encoding/json"
"time"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
"github.com/sirupsen/logrus"
View godgen.py
import random
domains = []
while True:
domains.append(random.randint(1,4))
if random.randint(1,2) == 1:
break
dom_table = {
1: ["Play", "Fertility/Harvest/Babies", "Health/Disease", "Hunt", "Hearth", "Doors/Household Safety", "Baking", "Wine/Beer", "Sewing/Weaving", "Wealth", "Household Item", "Food (particular)", "Important Commodity", "Male Virility", "Bridges/Gates/Crossing/Crossroads", "Fidelity/Adultery", "Animal Husbandry", "Gossip/Reputation", "Books/Scrolls", "Important Domestic Animal/Insect"],
View gist:446e5a35d4768536a1fd
# scala install
wget www.scala-lang.org/files/archive/scala-2.11.1.deb
sudo dpkg -i scala-2.11.1.deb
# sbt installation
wget wget http://scalasbt.artifactoryonline.com/scalasbt/sbt-native-packages/org/scala-sbt/sbt/0.13.1/sbt.deb
sudo dpkg -i sbt.deb
@jkopczyn
jkopczyn / pingpong.py
Created Oct 18, 2014
This Resembles FizzBuzz
View pingpong.py
def fizzbuzz():
x= raw_input("Max number for FizzBuzz/PingPong:")
fizz_ping_flag=1
fizz = ["fizz","ping"]
buzz = ["buzz","pong"]
fizzbuzz = ["fizzbuzz", "ping-pong"]
for i in range(1,int(x)):
if i%3 and i%5:
print i
elif not(i%3) and i%5: