Skip to content

Instantly share code, notes, and snippets.

View capoferro's full-sized avatar

Josiah Kiehl capoferro

View GitHub Profile
package swiss
import (
"log"
"math"
"sort"
)
type Scorer interface {
ID() int
import { cardText } from "../config/cardText";
import fileDownload from "js-file-download";
import { cardTypeIDs, setIDs, warbandLookup } from "../config/dataMapping";
const createSave = ObjectStates => {
return {
SaveName: "",
GameMode: "",
Date: "",
Table: "",
Unhandled Exception: System.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.Closure' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
at DLRCachedCode.test$1(CodeContext $globalContext, FunctionCode $functionCode)
at IronPython.Compiler.OnDiskScriptCode.Run()
at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options)
at IronPython.Runtime.ModuleLoader.load_module(CodeContext context, String fullName)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at IronPython.Runtime.PythonContext.Call(CodeContext context,
@capoferro
capoferro / docker-ssl-cert-generate
Last active May 14, 2017 02:09 — forked from cameron/docker-ssl-cert-generate
Generate self-signed SSL certs for docker client <— HTTPS —> daemon
#! /bin/bash
# HEADS UP! Make sure to use '*' or a valid hostname for the FDQN prompt
echo 01 > ca.srl
openssl genrsa -out ca-key.pem
openssl req -new -x509 -days 365 -key ca-key.pem -out ca.pem
openssl genrsa -out server-key.pem
openssl req -new -key server-key.pem -out server.csr
$tempPath = Join-Path $env:TEMP "dnvminstall"
$dnvmPs1Path = Join-Path $tempPath "dnvm.ps1"
$dnvmCmdPath = Join-Path $tempPath "dnvm.cmd"
Write-Host "Using temporary directory: $tempPath"
if (!(Test-Path $tempPath)) { md $tempPath | Out-Null }
$webClient = New-Object System.Net.WebClient
$webClient.Proxy = [System.Net.WebRequest]::DefaultWebProxy
[url "git@ghe_server.domain.com:"]
insteadOf = https://ghe_server.domain.com
gocd () {
for i in `find $GOPATH -name $1`
do (sh -c "ls $i/.git 2> /dev/null > /dev/null" || sh -c "ls $i/.hg" 2> /dev/null > /dev/null) && echo "cd $i" && cd $i
done
}
javascript:(function()%20{%20%20%20%20if%20(window.location.host%20!=%20"www.wowhead.com"%20&&%20window.location.host%20!=%20"wowhead.com")%20{%20%20%20%20%20%20alert("This%20is%20a%20bookmarklet%20that%20works%20on%20wowhead.com.%20Drag%20this%20link%20to%20your%20bookmarks%20bar.%20Navigate%20to%20an%20item's%20wowhead%20page%20and%20click%20the%20bookmarklet%20on%20your%20bar.%20This%20will%20automatically%20add%20the%20item%20to%20your%20list.");%20%20%20%20%20%20return%20false;%20%20%20%20}%20%20%20%20var%20bookmarklet_data%20=%20{"PlayerName":"Krahl","BaseUrl":"http://loot.reforged.net"};%20%20%20%20var%20player%20=%20encodeURIComponent(bookmarklet_data.PlayerName);%20%20%20%20var%20url%20=%20encodeURIComponent(window.location.href);%20%20%20%20var%20dropped_by_element%20=%20$(".whtt-droppedby");%20%20%20%20var%20dropped_by_string%20=%20"";%20%20%20%20if%20(dropped_by_element.length%20==%200)%20{%20%20%20%20var%20dropped_by_element%20=%20$("#tab-dropped-by%20tbody.clickable%20a:first");%20%20%20%20if%20
func AllPlayers() []*Player {
ikeys, _ := conn().Do("KEYS", playerTag + "*:item_list")
keys := make([]string, 0)
// OH MY GOD. I have no idea how to convert ikeys to a slice of
// strings. This feels incredibly dirty.
for _, key := range ikeys.([]interface{}) {
keys = append(keys, string(key.([]uint8)))
}
players := make([]*Player, 0)
for _, key := range keys {