Skip to content

Instantly share code, notes, and snippets.

View seebs's full-sized avatar

seebs seebs

View GitHub Profile
/*
* SK's Minecraft Launcher
* Copyright (C) 2010-2014 Albert Pham <http://www.sk89q.com> and contributors
* Please see LICENSE.txt for license information.
*/
package com.skcraft.launcher.util;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
0227_UATraps.pdf
02_UA_Underdark_Characters.pdf
04_UA_Classics_Revisited.pdf
1_UA_Artificer_20170109.pdf
2016_Fighter_UA_1205_1.pdf
2017_01_UA_RangerRogue_0117JCMM.pdf
20170213_Wizrd_Wrlck_UAv2_i48nf.pdf
2017_UAMassCombat_MCUA_v1.pdf
26_UASorcererUA020617s.pdf
M_2016_UAMonk1_12_12WKWT.pdf
/* someone posted to comp.lang.c asking for homework help. i felt the need to contribute.
* -seebs
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#include <stddef.h>
#include <math.h>
package main
import (
"flag"
"fmt"
"math/big"
"time"
)
/* there are four interesting values:
- // read from teensy
- return
- (PINF&(1<<0) ? 0 : (1<<0)) |
- (PINF&(1<<1) ? 0 : (1<<1)) |
- (PINF&(1<<4) ? 0 : (1<<2)) |
- (PINF&(1<<5) ? 0 : (1<<3)) |
- (PINF&(1<<6) ? 0 : (1<<4)) |
- (PINF&(1<<7) ? 0 : (1<<5)) ;
+ /* read from teensy
+ * bitmask is 0b11110011, but we want those all
package main
import (
"bytes"
"fmt"
"sync"
"time"
"github.com/daviddengcn/go-colortext"
)
@seebs
seebs / go2_generic_feedback.md
Created August 29, 2018 15:16
contract design feedback for go2 generics

One question occurs me with regards to this example:

contract mappable(k K, _ V) { k == k }

Why not

contract mappable[_ K, _ V] { var _ map[K]V }

This would, I think, make the intent much clearer.

@seebs
seebs / gist:58a7d32549dcd136dad09cb52fe277ad
Created December 6, 2018 02:36
someone asked me for help with their c homework once
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#include <stddef.h>
#include <math.h>
struct {
double lo, close;
@seebs
seebs / ttt.c
Created May 30, 2019 16:50
I apparently wrote this in 1996. I do not know how it works or why it works that way. I'm so sorry.
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* tic tac toe. we must draw reliably. */
enum players { x, o };
int turn = x;
@seebs
seebs / c2.sh
Created May 30, 2019 16:59
A C interpreter as a shell script. Note, this is every bit as stupid as it sounds. The summer of 1995 was not a great time for good engineering decisions for me.
#!/bin/sh
# C interpreter in sh. Wow.
# Logic: we parse files, or arguments, or stdin.
# We see if we have exactly one argument that looks like a file. If so,
# we parse it. Otherwise, we look for arguments. Otherwise, we work on
# stdin.
ANSI="Y"
VERBOSE="N"
INCLUDES="stdio.h stdlib.h ctype.h"