Skip to content

Instantly share code, notes, and snippets.

@tckmn
tckmn / gist:8078a34e3287ec32dadf
Created November 8, 2014 16:31
(Almost) all Nethack messages, more gooder version (much better)
pager.c:344 pline("Cannot open data file!")
pager.c:467 pline("? Seek error on 'data' file!")
pager.c:482 pline("I don't have any information on those things.")
pager.c:578 pline("Please move the cursor to %s.", what_is_an_unknown_object)
pager.c:581 pline("Pick an object.")
pager.c:815 pline("%s", out_str)
pager.c:825 pline("I've never heard of such things.")
pager.c:865 pline("That is %s%s%s.", an(defsyms[trap_to_defsym(tt)].explanation), !trap->madeby_u ? "" : (tt == WEB) ? " woven" : <x> <x> <x> (tt == HOLE || tt == PIT) ? " dug" : " set", !trap->madeby_u ? "" : " by you")
pager.c:876 pline("I can't see a trap there.")
pager.c:891 pline("Cannot open data file!")
@tckmn
tckmn / 08.rb
Created December 8, 2020 05:28
aoc 2020 day 8
def f idx
code = read.lines.map{|x|
a,b = x.split
[a,b.to_i]
}
return if code[idx][0] == 'acc'
code[idx][0] = code[idx][0] == 'jmp' ? 'nop' : 'jmp'
executed = code.map{false}
@tckmn
tckmn / unity.txt
Last active July 24, 2020 22:51
ranting
commit 8e57aaf2a32160753306efb3a0b3660c80fa5b41
Author: tckmn
Date: Tue Jun 21 12:12:18 2016 -0400
Unity is dumb
Apparently it wants materials in the same folder as the models so I
guess I have to do this
commentary: The context for this is that Unity kept creating materials called
@tckmn
tckmn / script.sh
Last active March 31, 2020 19:35
stack exchange dark theme
#!/usr/bin/env bash
go() {
curl $1$2 | sed 's!url(\(.\)\.\.!url(\1'$1'..!g'
}
{
go https://cdn.sstatic.net/Shared/ stacks.css
go https://cdn.sstatic.net/Sites/stackoverflow/ primary.css
} | sed '
s/theme-dark/unified-theme/g;
s/prefers-color-scheme:dark/min-width:1px/g;
1-INDEXED, TOP TO BOTTOM, 2D
[[8, 10, 3, 11], [2, 11, 8, 12], [1, 7, 4, 9], [8, 7, 11, 13], [1, 12, 6, 13], [2, 7, 11, 1], [7, 12, 8, 3], [9, 5, 6, 10], [13, 13, 4, 5], [2, 6, 12, 4], [3, 5, 9, 10], [5, 4, 9, 10], [6, 1, 3, 2]]
[[8, 5, 4, 13], [11, 3, 7, 9], [11, 6, 12, 12], [4, 2, 6, 9], [10, 1, 3, 1], [6, 10, 9, 11], [6, 4, 7, 2], [8, 5, 13, 7], [5, 10, 3, 13], [2, 7, 1, 3], [1, 13, 8, 10], [12, 9, 8, 5], [12, 4, 2, 11]]
[[11, 6, 13, 12], [9, 1, 9, 5], [11, 12, 13, 8], [3, 8, 13, 5], [3, 7, 3, 7], [1, 8, 6, 13], [8, 12, 9, 6], [11, 4, 5, 2], [10, 2, 1, 7], [1, 6, 9, 3], [2, 11, 10, 4], [5, 2, 7, 4], [10, 4, 10, 12]]
[[7, 12, 1, 5], [5, 6, 11, 11], [5, 11, 3, 4], [7, 12, 9, 13], [12, 1, 4, 8], [4, 9, 3, 13], [7, 10, 10, 6], [1, 3, 13, 10], [1, 8, 6, 4], [6, 5, 12, 13], [10, 2, 2, 3], [9, 9, 8, 2], [2, 7, 8, 11]]
[[11, 10, 12, 9], [9, 8, 8, 4], [10, 13, 5, 13], [5, 13, 5, 6], [2, 6, 9, 2], [11, 4, 3, 8], [3, 10, 12, 11], [1, 7, 5, 9], [7, 6, 4, 3], [12, 7, 2, 7], [11, 4, 10, 3], [1, 12, 13, 6], [1, 2, 8, 1]]
@tckmn
tckmn / input.txt
Created December 19, 2018 19:29
Bookworm Deluxe dictionary
aa
2h
3ed
ing
s
2l
3iis
s
2rdvark
8s
@tckmn
tckmn / setlocale.cpp
Last active December 3, 2017 16:21
setlocale for Haiku
/*
* Copyright 2017 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Andrew Tockman, andy@keyboardfire.com
*/
#include <stdio.h>
#include <stdlib.h>
@tckmn
tckmn / test.cpp
Created December 3, 2017 00:05
broken GetHasGlyphs call
#include <Font.h>
#include <String.h>
int main()
{
BString str("test");
int len = str.CountChars();
bool has[len];
be_fixed_font->GetHasGlyphs(str.String(), len, has);
}
@tckmn
tckmn / keymap.c
Created November 19, 2017 17:15
my qmk config
#include "planck.h"
#include "action_layer.h"
#include "virtser.h"
#include "keymap_steno.h"
extern keymap_config_t keymap_config;
#define QWERTY 0
#define PLOVER 1
#define RAISE 2
@tckmn
tckmn / codepage.md
Last active July 8, 2017 14:06
Compose key shortcuts for the Jelly codepage

Jelly's codepage was created by @DennisMitchell.

|_0|_1|_2|_3|_4|_5|_6|_7|_8|_9|_A|_B|_C|_D|_E|_F ---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|--- 0|¡ !!|¢ c||£ L-|¤ xo|¥ Y=|¦ !^|© oc|¬ -,|® or|µ mu|½ 12|¿ ??| C=|Æ AE|Ç C,|Ð DH 1|Ñ N~|× xx|Ø O/|Œ OE|Þ TH|ß ss|æ ae|ç c,|ð dh|ı i.|ȷ j.|ñ n~|÷ :-|ø o/|œ oe|þ th 2| |!|"|#|$|%|&|'|(|)|*|+|,|-|.|/ 3|0|1|2|3|4|5|6|7|8|9|:|;|<|=|>|? 4|@|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O 5|P|Q|R|S|T|U|V|W|X|Y|Z|[|\|]|^|_