Skip to content

Instantly share code, notes, and snippets.

View lantins's full-sized avatar

Luke Antins lantins

View GitHub Profile
@lantins
lantins / notes.md
Last active March 11, 2016 14:49
AMP font format

[16 byte header][128 * 256 byte glyphs]

  • 16 byte header:
    • ? bytes 0-1: number of nibbles (pixels) per line?
    • ? bytes 2-3: width of glyph?
    • ? bytes 4-5: hight of glyph?
    • ? bytes 6-7: number of glyphs
    • ? bytes 8-15: no idea
  • Each glyph is represented using 256 bytes:
    • 16 pixels wide, each pixel stored in a nibble, 8 bytes total.
/opt/titchy/tmp/gcc-build-final/./gcc/xgcc -B/opt/titchy/tmp/gcc-build-final/./gcc/ -B/opt/titchy/toolchain/arm-linux-gnueabihf/bin/ -B/opt/titchy/toolchain/arm-linux-gnueabihf/lib/ -isystem /opt/titchy/toolchain/arm-linux-gnueabihf/include -isystem /opt/titchy/toolchain/arm-linux-gnueabihf/sys-include -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -fno-inline -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc.map -o ./libgcc_s.so.1.tmp -g -O2 -B./ _thumb1_case_sqi_s.o _thumb1_case_uqi_s.o _thumb1_case_shi_s.o _thumb1_case_uhi_s.o _thumb1_case_si_s.o _udivsi3_s.o _divsi3_s.o _umodsi3_s.o _modsi3_s.o _bb_init_func_s.o _call_via_rX_s.o _interwork_call_via_rX_s.o _lshrdi3_s.o _ashrdi3_s.o _ashldi3_s.o _arm_negdf2_s.o _arm_addsubdf3_s.o _arm_muldivdf3_s.o _arm_cmpdf2_s.o _arm_unorddf
vagrant@xpile:/opt/titchy/build$ echo 'main(){}' > dummy.c
vagrant@xpile:/opt/titchy/build$ ${TITCHY_TARGET}-gcc dummy.c
dummy.c:1:1: warning: return type defaults to 'int' [-Wimplicit-int]
main(){}
^
/opt/titchy/toolchain/lib/gcc/arm-linux-gnueabihf/5.1.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find /opt/titchy/toolchain/arm-linux-gnueabihf/lib/libc.so.6 inside /opt/titchy/toolchain/arm-linux-gnueabihf
/opt/titchy/toolchain/lib/gcc/arm-linux-gnueabihf/5.1.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find /opt/titchy/toolchain/arm-linux-gnueabihf/lib/libc_nonshared.a inside /opt/titchy/toolchain/arm-linux-gnueabihf
/opt/titchy/toolchain/lib/gcc/arm-linux-gnueabihf/5.1.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find /opt/titchy/toolchain/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 inside /opt/titchy/toolchain/arm-linux-gnueabihf
collect2: error: ld returned 1 exit status
@lantins
lantins / 01-env-setup.sh
Last active August 29, 2015 14:21
_failing_ attempt at ECLFS with glibc
#!/bin/bash
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
logFatal 'You _must_ `source env-setup.sh` this file, not execute it.'
fi
# --- Directories and paths ----------------------------------------------------
export TITCHY=/opt/titchy
export PATH=${TITCHY}/toolchain/bin:/bin:/usr/bin
@lantins
lantins / gist:2216a4befe96ea3cca81
Created March 8, 2015 00:07
snipped of simple collision detection
- (void)collisionDetection
{
if (state != kSPECTRA_STATE_ACTIVE) {
return;
}
NSMutableIndexSet *bulletsToRemove = [[NSMutableIndexSet alloc] init];
NSMutableIndexSet *asteroidsToRemove = [[NSMutableIndexSet alloc] init];
[
{ "keys": ["ctrl+shift+r"], "command": "reindent" , "args": { "single_line": false } }
]
@lantins
lantins / Makefile
Created January 11, 2015 01:35
"Auto build & serve" of golang code :)
#
# Makefile to perform "live code reloading" after changes to .go files.
#
# n.b. you must install fswatch (OS X: `brew install fswatch`)
#
# To start live reloading run the following command:
# $ make serve
#
# binary name to kill/restart
- http://www.alexedwards.net/blog/golang-response-snippets
- https://devcharm.com/articles/8/go-nethttp-handlers/
- http://openmymind.net/Things-I-Wish-Someone-Had-Told-Me-About-Go/
- https://elithrar.github.io/article/custom-handlers-avoiding-globals/
- https://elithrar.github.io/article/map-string-interface/
- https://elithrar.github.io/article/approximating-html-template-inheritance/
- http://blog.golang.org/error-handling-and-go
- https://golang.org/doc/articles/wiki/
- https://medium.com/@benbjohnson/structuring-applications-in-go-3b04be4ff091
- https://justinas.org/best-practices-for-errors-in-go/
@lantins
lantins / proxy_writer.go
Created January 5, 2015 20:11
proxy_writer.go
// proxyWriter is used to track final status and size of the
// response sent to the client
type proxyWriter struct {
http.ResponseWriter
status int
size int
}
func (r *proxyWriter) Header() http.Header {
return r.ResponseWriter.Header()
@lantins
lantins / main.go
Last active August 29, 2015 14:12
Golang - HTTP Server - Contexts
package main
import (
"fmt"
"github.com/julienschmidt/httprouter"
"log"
"net/http"
"os"
"strconv"
)