Skip to content

Instantly share code, notes, and snippets.

View jkopczyn's full-sized avatar

Jacob Kopczynski jkopczyn

View GitHub Profile
@jkopczyn
jkopczyn / pingpong.py
Created October 18, 2014 00:37
This Resembles FizzBuzz
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:
# 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 / godgen.py
Created December 26, 2018 23:25
Automated god generator, implements http://www.rolang.com/archives/449
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"],
@jkopczyn
jkopczyn / submit-metrics-example.go
Last active August 11, 2022 19:32
datadog submit metrics to nonstandard endpoint
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"
@jkopczyn
jkopczyn / server-example.go
Last active August 11, 2022 19:33
server to make datadog SubmitMetrics crash
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)
}