Skip to content

Instantly share code, notes, and snippets.

View ustvariants.go
var ustVariants = map[string]map[string]string{
"Amateur Auteur": map[string]string{
"ravnica": "3a",
"innistrad": "3b",
"theros": "3c",
"zendikar": "3d",
"version 1": "3a",
"ravnica silver": "3a",
"innistrad blue": "3b",
"theros red": "3c",
View gist:3d7a1c8856d4b7319a26883cb5049121
Sakura-Tribe Elder
PJAS: unset tcgproductid
PJJT: unset tcgproductid
PJSE: no change
PSUS: unset tcgproductid
Serra Avatar
PSUS: no change

TL:DR; I'm not sure if it just a data problem or i'm tackling the problem wrong


What i'm trying to do is getting a list of entries with variable properties mapped to a well known list of entries with fixed properties

In other words i have a variable textual entry composed of {"ABC (test)" "wrongdata"} which needs to be mapped to to a fixed entry {"ABC" "test"}

Problem statement

There are a variety of data providers that output entries with different combinations of fields and values that need to possibly be mapped to the same final entry.

View load.go
func LoadAllPrintings(allPrintingsPath string) error {
allPrintingsReader, err := os.Open(allPrintingsPath)
if err != nil {
return err
defer allPrintingsReader.Close()
dec := json.NewDecoder(allPrintingsReader)
_, err = dec.Token()
if err != nil {
View mtgbuylister.js
javascript:(function() {
var card = prompt("Card Name");
if (!card || card == "") {
trimmedCard = card.trim();
var sites = [];
/* Buylists */
View mtgtycoon.js
javascript:(function() {
var card = prompt("Card Name");
var sites = [];
View kierank.diff
diff --git a/common/base.h b/common/base.h
index 28fc6524..38769d33 100644
--- a/common/base.h
+++ b/common/base.h
@@ -49,6 +49,31 @@
#include <limits.h>
#include "x264.h"
+x264_t *x264_8_encoder_open( x264_param_t * );
View mixed storage probably
View gist:2e789486503911592265e39d826958c5
$ ./configure
generating config.mak ...
usage: tr [-Ccsu] string1 string2
tr [-Ccu] -d string1
tr [-Ccu] -s string1
tr [-Ccu] -ds string1 string2
View file.c
uint32_t max_coord = (uint32_t) -1;
size_t orig_width = (size_t) sc->width * max_coord / (max_coord - r - l);
size_t orig_height = (size_t) sc->height * max_coord / (max_coord - b - t);
sc->spherical->left_bound = ceil(orig_width * l / max_coord);
sc->spherical->top_bound = ceil(orig_height * t / max_coord);
sc->spherical->right_bound = orig_width - sc->width - sc->spherical->left_bound;
sc->spherical->bottom_bound = orig_height - sc->height - sc->spherical->top_bound;