Skip to content

Instantly share code, notes, and snippets.

@geoffrasb
geoffrasb / console.v
Created June 13, 2012 12:09
brainfuck implementation in verilog
module Console_module (
input reset,
output [7:0] LCD_DATA,
output LCD_ENABLE,
output LCD_RW,
output LCD_RSTN,
output LCD_CS1,
output LCD_CS2,
output LCD_DI,
input lcd_clock,
@geoffrasb
geoffrasb / gist:3049840
Created July 4, 2012 22:30
emacs notes
C-v ->vim:c-d
m-v ->vim:c-u
c-l ->vim:z.
c-u 0 c-l
m-f ->vim:w
c-a ->vim:0
c-e ->vim:$
m-a ->vim:{
m-e ->vim:}
m-< ->vim:gg
@geoffrasb
geoffrasb / gist:4075271
Created November 14, 2012 22:21
matlab: matrix construction
expand(vec,dims)
# split vec into layers
ex:expand([1;2],[]) -> [1;2]
expand([1;2],[2]) -> [1 2;
1 2]
expand([1;2],[2 3]) ->
1 1 1 2 2 2
1 1 1 2 2 2 (a 2*3*2 matrix)
expand([1;2;3],[1 2]) ->
1 1 2 2 3 3 (a 1*2*3 matrix)
@geoffrasb
geoffrasb / data.c
Last active December 27, 2015 20:39
little typing sys
/*
for each type:
1. Define in Type as "newtype_t".
2. Define constructors.
If struct is needed, name it "Newtype_t".
3. Define "_deNewtype", which typed as "Data -> void".
*/
#include<assert.h>
@geoffrasb
geoffrasb / Parser.js
Last active August 29, 2015 13:57
[JS] FP facilities and Parser Combinator
window.Parser = {
/* need to add mutual-recursive parser combinator
components:
reg
eof
ret
opt
seq
tryp
@geoffrasb
geoffrasb / frp_note.txt
Last active September 4, 2015 10:07
FRP learning note
reference: Functional Reactive Animation - by Conal Elliott et al
* 2 things:
- Behavior a
- Event a
* semantic functions
- at :: Behavior a -> Time -> a
- occ :: Event a -> (Time, a)