Skip to content

Instantly share code, notes, and snippets.

@21isgonnabeagoodyear
21isgonnabeagoodyear / sendfetch.go
Created March 20, 2015 22:16
send and receive a file without fuss over LAN
package main
import "net/http"
import "fmt"
import "io"
import "os"
//import "io/ioutil"
//starts an http server on :8000
//allows a single file to be uploaded and a single file to be downloaded to the locations specified as arguments
@21isgonnabeagoodyear
21isgonnabeagoodyear / chat.go
Created August 6, 2014 02:27
chat program in go
package chat
import "net/http"
import "sync"
import "html/template"
import "time"
import "strings"
type chatpost struct{
text string
when time.Time
@21isgonnabeagoodyear
21isgonnabeagoodyear / gcc2naken430
Last active August 29, 2015 14:01
build c code for msp430 using msp430-elf-gcc and naken430asm
#!/bin/sh
#compile it
msp430-elf-gcc -S $1 -o build.s
#remove all the crap gcc throws in, and initialize the stack (0x27f) & org (0xf800)
cat build.s | sed "s/\.text/\.org 0xf800/g" | sed "s/\.file/;\.file/g" | sed "s/\.balign/;\.balign/g" | sed "s/\.global/;\.global/g" | sed "s/\.size/;\.size/g" | sed "s/\.ident/;\.ident/g" |sed "s/\.L/L/g" |sed "s/main:/main:mov.w #0x27f, sp\n mov.w #0x5a80, &0x120;disable wdt/g" |sed "s/{/\n/g" >build2.s
#run main on reset
echo ".org 0xfffe" >> build2.s
echo " dw main" >> build2.s
#assemble it to out.hex