Skip to content

Instantly share code, notes, and snippets.

View siennathesane's full-sized avatar
😃
tickle the code, make it laugh

Sienna siennathesane

😃
tickle the code, make it laugh
View GitHub Profile
import json
from copy import copy
from pprint import pprint
data = """{
"networks_and_azs":{
"networks_and_azs": {
"singleton_availability_zone": {
"name": "null"
},
@siennathesane
siennathesane / config.go
Created May 17, 2017 19:16
windows app configs
type Configuration struct {
ApplicationDefaults ApplicationDefaults `xml:"system>applicationHost>sites>applicationDefaults"`
FailureDefinitions []FailureDefinitions `xml:"system>webServer>tracing>traceFailedRequests>add>failureDefinitions"`
RequestFiltering []RequestFiltering `xml:"system>webServer>security>requestFiltering"`
Add []Add `xml:"configProtectedData>providers>add"`
Application Application `xml:"system>applicationHost>sites>site>application"`
Validation []string `xml:"system>webServer>validation"`
AddTraceProviderDefinitionsTracingWebServerSystem [][]Add `xml:"system>webServer>tracing>traceProviderDefinitions>add"`
ClientCertificateMappingAuthentication []string `xml:"system>webServer>security>authentication>clientCertificateMappingAuthentication"`
AddModulesWebServerSystem [][]Add `xml:"system>webServer>modules>add"`
This file has been truncated, but you can view the full file.
Date/Time: 2017-03-29 15:31:35 -0600
OS Version: Mac OS X 10.12.4 (Build 16E195)
Architecture: x86_64h
Report Version: 25
Data Source: Stackshots
Command: gogland
Path: /Users/USER/Library/Application Support/JetBrains/*/Gogland 1.0 EAP.app/Contents/MacOS/gogland
Version: EAP GO-171.3780.106 (GO-171.3780.106)
@siennathesane
siennathesane / main.go
Last active March 27, 2017 19:32
UAA test code.
package main
import (
"time"
"context"
"fmt"
"encoding/json"
"golang.org/x/oauth2"
"net/http"
"crypto/tls"
@siennathesane
siennathesane / eitri-sql.sql
Last active February 13, 2017 19:09
Table Creation Script
-- create the users table.
CREATE TABLE `users` (
`userid` int(11) NOT NULL,
`username` varchar(45) NOT NULL,
`userhash` varchar(45) NOT NULL,
`aws_client` varchar(45) DEFAULT NULL,
`aws_secret` varchar(45) DEFAULT NULL,
`gce_client` varchar(45) DEFAULT NULL,
`gce_secret` varchar(45) DEFAULT NULL,
PRIMARY KEY (`userid`)
swagger: '2.0'
# This is your document metadata
info:
version: "0.1.0"
title: Eitri
description: "Turns lab infrastructure on and off in an automated fashion for cloud providers."
# Describe your paths here
paths:
@siennathesane
siennathesane / sieve.go
Created January 24, 2017 19:36
Miller-Rabin Primality Test
// IsProbablePrime Miller-Rabin primality test.
func IsProbablePrime(a int) bool {
if a == 2 {
return true
}
if a == 1 || a%2 == 0 {
return false
}
m := a - 1
@siennathesane
siennathesane / log.go
Created December 3, 2016 05:40
Generate random logs.
package utils
import (
"time"
"math/rand"
"strings"
"strconv"
"github.com/satori/go.uuid"
"fmt"
"io/ioutil"
@siennathesane
siennathesane / n.go
Created December 1, 2016 07:07
This will give every possible move in Boggle from your current location.
func neighbours(x, y int, ch <-chan map[int]int) {
for nx := 0; nx < math.Max(math.Max(float64(x), float64(x-1)), math.Min(float64(x+2), boardSize)); nx++ {
for ny := 0; ny < math.Max(math.Max(float64(0), float64(y-1)), math.Min(float64(y+2), boardSize)); ny++ {
ch <- map[int]int{int(nx): int(ny)}
}
}
}
@siennathesane
siennathesane / Metrics.cs
Created November 23, 2016 06:18
Character metrics...
// Metrics.cs
// Monitors the characters metrics.
namespace PixelDungeon.pdlib.metrics
{
public class Walk
{
public double Steps = 0;
public double Distance = 0;
public double ItemsGathered = 0;