Skip to content

Instantly share code, notes, and snippets.

@adam000
adam000 / cards.txt
Created January 30, 2021 15:37
List of Dominion cards by expansion / category
Size 13 bold Trajan Pro
## Non-Kingdom / Non-Supply Cards (I keep these in their own collection, not alphabetized like the rest)
Copper
Silver
Gold
Platinum
Estate
Duchy
@adam000
adam000 / shorten-ow-highlights.bash
Last active April 4, 2020 22:20
A simple way to shorten Overwatch highlights from the comfort of WSL
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
WINHOME="/mnt/c/Users/atg"
NPROCS=10
# NOTE: nothing in the ls arg can have spaces or this doesn't work
ls $WINHOME/Documents/Overwatch/videos/overwatch/*.mp4 | xargs -n 1 -l -P $NPROCS -i{} bash -c 'ffmpeg -hide_banner -loglevel debug -ss 00:00:04.800 -i "{}" -t 00:00:12.500 -c copy "/mnt/f/Shortened OW Highlights/$(basename "{}")" && rm "{}"'
@adam000
adam000 / main.go
Last active November 23, 2018 22:18
I'm not sure what I'm doing wrong with FlatBuffers... (note, directories in filenames are noted by dashes since GH doesn't allow slashes, so myGame-replay.go should be at myGame/replay.go)
package main
import (
"io/ioutil"
"log"
"myGame/replay"
)
func main() {
package main
// #cgo pkg-config: lua
/*
#cgo pkg-config: lua
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
int my_luaL_loadbuffer(lua_State* L, const char* s, size_t sz, const char* m) {
@adam000
adam000 / MARS.c
Last active August 23, 2018 20:47
MARS - Macroized Applied Rapid Substitution
// :execute "normal" "mAj^W\"nyEW\"ayEW\"byEk" | execute "normal" @n . "k" | execute ".,.+" . @n . "s/" . @a . "/" . @b | execute "normal" "'A"
// 25 FooApi BarApi
// Explanation:
// mark line as A mA
// down one line j
// beginning of content ^
// next Word W
// Copy Word to n, continue \"nyEW
@adam000
adam000 / luaRepl.go
Created August 23, 2018 03:31
Some of this is taken from the PiL book example on doing this in C
package main
// #cgo pkg-config: lua
/*
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#include <string.h>
#include <stdio.h>
@adam000
adam000 / .zshrc
Last active August 16, 2016 17:38 — forked from boredzo/colorman.zsh
Color Terminal for bash/zsh etc.. (my own colorscheme)
# Even easier than making a function and subshells and all of that, just set the values in your RC! Other things that use
# TERMCAP can now take advantage of these values.
export LESS_TERMCAP_md=$'\e[1;31m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[1;36m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[4;32m'
@adam000
adam000 / which_class.php
Last active July 26, 2016 15:53
A small test to see what gets returned for the various "I want to know what class I'm in" patterns in PHP
<?php
class base {
static function whoami_static() {
echo('__CLASS__: ' . __CLASS__ . "\n");
echo('get_class(): ' . get_class() . "\n");
echo('get_called_class(): ' . get_called_class() . "\n");
echo('static::class: ' . static::class . "\n");
}
@adam000
adam000 / config.go
Last active July 13, 2016 18:09
It took me a while to figure out how to run a sudo command (which requires an interactive console, in my case) with Go's SSH package. This is what I found.
package main
const (
sshKey string = "/Users/myuser/.ssh/id_rsa_mykey"
hostname string = "myhost.com"
)

Keybase proof

I hereby claim:

  • I am adam000 on github.
  • I am adam_0 (https://keybase.io/adam_0) on keybase.
  • I have a public key whose fingerprint is 9C68 2F61 E3FE 7EF4 C179 9FA3 7C78 905F 5897 D6C9

To claim this, I am signing this object: