This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// let realRawData = `...` | |
// Note: The following code uses inconsistant processing strategies for the purposes of example. | |
{ | |
//// Utility Functions //// | |
const querySelectorAll = (node, expr) => node.querySelectorAll(expr); | |
const querySelector = (node, expr) => node.querySelector(expr); | |
function* queryXPathAll(node, expr) { | |
const evaluator = new XPathEvaluator(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Will error with "yaml: did not find expected alphabetic or numeric character" | |
x-test-service-image: &test-service.image "ubuntu" | |
services: | |
test-service: | |
image: *test-service.image | |
command: bash -c 'echo hello world; sleep 30' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import dataclass, fields, asdict | |
from json import dumps | |
@dataclass | |
class Foo: | |
a: int | |
b: str | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import mechanize | |
import os | |
import re | |
import sys | |
from getpass import getpass | |
# Inputs | |
USERNAME = os.environ.get("FOUNDRY_USERNAME") or input("Username?") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (flipX=true, flipY=true){ | |
// Note, Wall PlaceableObjects | |
const walls = canvas.walls.controlled; | |
if (walls.length === 0){ | |
return; | |
} | |
let xBounds = [walls[0].data.c[0], walls[0].data.c[2]]; | |
let yBounds = [walls[0].data.c[1], walls[0].data.c[3]]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; MIT License | |
; | |
; Copyright (c) 2020 Clay Sweetser | |
; | |
; Permission is hereby granted, free of charge, to any person obtaining a copy | |
; of this software and associated documentation files (the "Software"), to deal | |
; in the Software without restriction, including without limitation the rights | |
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
; copies of the Software, and to permit persons to whom the Software is | |
; furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Sample fixture pattern for data generation. | |
Note that this is merely a pattern, not a complete implementation. | |
Provides two fixtures: | |
- A `pet_generator` fixture that allows a test to generate arbitrary pets. | |
- A `pet` fixture that represents a single pet. | |
Both fixtures clean up resources. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
OneType = object | |
fieldA: string | |
TwoType = ref object | |
{.genProcedures.} | |
fieldB: int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
OneType = object | |
fieldA: string | |
TwoType {.genProcedures.} = ref object | |
fieldB: int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_dsl = regexes.to_regex(r""" | |
(?(DEFINE) | |
# Divider for syntactical elements | |
(?P<syntax_edge> \s+ ) | |
# Divider for statements | |
(?P<statement_edge> (?: | |
# A syntax edge | |
( | |
**syntax_edge |