Skip to content

Instantly share code, notes, and snippets.

View osvein's full-sized avatar

Oskar Sveinsen osvein

View GitHub Profile
@osvein
osvein / table.awk
Last active May 13, 2022 23:40
Render delimiter-separated values (e.g. CSV, TSV)
#!/usr/bin/awk -f
# table.awk - render [delimiter-separated values](https://en.wikipedia.org/wiki/Delimiter-separated_values)
# Example usage:
# awk -F , table.awk input.csv
# awk -F "\t" table.awk input.tsv
# ./table.awk FS=, input.csv
# ./table.awk FS="\t" input.tsv
NR == 1 && ARGV[ARGC - 1] == FILENAME { ARGV[ARGC++] = FILENAME; }
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "arg.h"
static void
usage(void)
{
printf(stderr, "usage: %s [-b base] [-l length]", argv0);
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#define FORDICE(n) for (dice[n] = 1; dice[n] <= 6; dice[n]++)
typedef uint_least8_t Score;
typedef uint_fast8_t Die;
Die dice[5];
/* pas - papyrus assembler
* Copyright (C) 2017 Oskar Sveinsen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "parser.h"
/* general */
Nonterminal n_doc_string = {
PROD_LEAF(t_bracket_curly_closing),
PROD(NULL, n_doc_string),
};
Nonterminal n_doc = {
export PROJECTFILE ?= $(realpath Project)
CHILDREN ?= $(sort $(dir $(wildcard */Makefile.custom) $(wildcard */Makefile)))
CHILDCARD ::= $(addsuffix %,$(CHILDREN))
%: $(CHILDCARD)
$(CHILDCARD):
dir = ${$@%%/*}
cd $dir
reltarget = ${$@#*/}
( test -f Makefile.custom\
;/ DrinkFromWaterFountainScript for Finite Water
/ Copyright (c) 2017 Oskar Sveinsen
/
/ 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:
/
e|-----5---5---4h5---7---5---2-----------------------------------------|
B|-------------------------------5--3---3---2ph3---5---3---------------|
G|---------------------------------------------------------4---2-------|
D|---------------------------------------------------------------------|
A|---------------------------------------------------------------------|
E|---------------------------------------------------------------------|
e|--------------2---4--4h5---2-----------------------------------------|
B|--2---3---5--------------------5-------------------------------------|
G|---------------------------------------------------------------------|
{
e|-------------------------------------------|
B|---5------5-5-4---3---2---2---2---2--------|
G|-------------------------------(3)--2(/3)--|
D|-------------------------------------------|
A|-------------------------------------------|
E|-------------------------------------------|
e|---2---2---2-0-2-3-4---4---4---------------|
B|-----------------------------2-3---4---2---|
#include <stdio.h>
#define READ2() (data
const char magic[] = { 0xDE, 0xC0, 0x57, 0xFA }; /* 0xFASTCODE */
char
pass1(void)
{
}