This file contains 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
''' | |
Timespan is code for visualizing timelines of events. We can show spans of time | |
on a timeline, as well as individual events. | |
The following is example code and what it prints: | |
>>> example_timespans = [ | |
... TimeSpan(1647922287310, 1647922287564, 'A short thing happened'), | |
... TimeSpan(1648123040908, 1648123109165, 'a span of time where things happening'), | |
... ] |
This file contains 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
// Compile with: | |
// gcc ./cmdinfo.c -lm -o cmdinfo | |
#include <stdio.h> /* printf(), fprintf() */ | |
#include <string.h> /* strcmp() */ | |
#include <math.h> /* log10(), ceil() */ | |
// fwd decl to cease warnings | |
int print_arguments(FILE* outf, int argc, char *const *argv); | |
int xxdline(int lineno, char* input, int inputlen, char* outbuf); |
This file contains 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
package main | |
import ( | |
"fmt" | |
"go/ast" | |
"go/parser" | |
"go/token" | |
"io/fs" | |
"io/ioutil" | |
"log" |
This file contains 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
#!/bin/bash | |
# Originally based on ag-replace.sh: | |
# https://gist.github.com/adamryman/1de22e36a14c29da2f41c8512cb86b6d | |
usage() { | |
echo "Usage: $(basename $0) \"THIS\" \"THAT\""; | |
echo "Replaces all instances of THIS with THAT in all files which contain THIS." | |
echo "Additionally, prints each file as that file is modified" | |
exit 1; |
This file contains 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
#!/bin/bash | |
usage() { | |
echo "Usage: $(basename $0) \"THIS\" \"THAT\""; | |
echo "Replaces all instances of THIS with THAT in all files which contain THIS." | |
echo "Additionally, prints each file as that file is modified" | |
exit 1; | |
} | |
This file contains 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
#!/usr/bin/env python3 | |
# | |
# Copyright (c) 2022 Leland Batey. All rights reserved. | |
# | |
# This work is licensed under the terms of the MIT license. | |
# For a copy, see <https://opensource.org/licenses/MIT>. | |
''' | |
Reads a CSV on stdin and writes a CSV on stdout. The output CSV should be | |
semantically identical to the input CSV, except that each cell will have | |
newline characters ('\n') replaced with an escaped newline ('\\n'). The |
This file contains 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 | |
def arena_card_db(): | |
carddb = dict() | |
with open("AllCards.json", 'r') as mtgjsonf: | |
carddb = json.load(mtgjsonf) | |
arena_cards = list() | |
for card_name, card in carddb.items(): |
This file contains 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
#!/usr/bin/env python3 | |
''' | |
Treeify takes a file (on stdin or passed as the first argument) and converts | |
it's indentation into a 'tree' representation. As an example: | |
what | |
is | |
this | |
thing | |
that's |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<!--<script src="timemachine.js"></script>--> | |
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment-with-locales.min.js"></script>--> | |
<body style="margin: 0;"> | |
<canvas id='canvas' width='1000' height='1000'></canvas> | |
</body> |
This file contains 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
; Stardew Valley animation cancel script | |
; Original from this post: | |
; https://forums.stardewvalley.net/threads/a-better-animation-canceling-autohotkey-script.7391/ | |
; This version has been modified to be slightly more explicit about things like | |
; making sure that the Keyboard Hooks are in use. | |
; WARNING: make sure that the "Check/Do Action" control within the options of | |
; Stardew Valley is bound to a *DIFFERENT* key than the key that this script uses | |
; to trigger the animation canceling. If you have this script bound to the same | |
; key as the "Check/Do Action" key in-game, you'll face issues where holding down |