Skip to content

Instantly share code, notes, and snippets.

View Varriount's full-sized avatar

Clay Sweetser Varriount

View GitHub Profile
import json
import mechanize
import os
import re
import sys
from getpass import getpass
# Inputs
USERNAME = os.environ.get("FOUNDRY_USERNAME") or input("Username?")
(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]];
@Varriount
Varriount / mousekeys.ahk
Created February 1, 2021 02:31
AutoHotkey script to control the keyboard via the mouse.
; 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:
@Varriount
Varriount / generate_fixture_pattern.py
Created January 14, 2021 08:09
Sample fixture generator pattern.
"""
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.
type
OneType = object
fieldA: string
TwoType = ref object
{.genProcedures.}
fieldB: int
type
OneType = object
fieldA: string
TwoType {.genProcedures.} = ref object
fieldB: int
_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
# Compile with --gc:arc
import ngxcmod, strutils
proc init(ctx: ContextCycle) {.exportc: "ngx_link_func_init_cycle", dynlib, cdecl.} =
setupForeignThreadGc()
ctx.cyc_log(INFO, "hello from Nim")
proc exit(ctx: ContextCycle) {.exportc: "ngx_link_func_exit_cycle", dynlib, cdecl.} =
setupForeignThreadGc()
ctx.cyc_log(WARN, "goodbye, from Nim w/ <3")
@Varriount
Varriount / PropertyLogger.java
Last active June 18, 2020 17:04 — forked from sandor-nemeth/PropertyLogger.java
Spring Boot - Log all configuration properties on application startup
package org.flowable.rest.app;
import java.util.Arrays;
import java.util.stream.StreamSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.core.env.AbstractEnvironment;
proc this: void {.cdecl, exportc, dynlib.} =
var i = 1
var a = 2
var z = 3
proc foo(): int =
echo "here"
return i + a + z + 65