Skip to content

Instantly share code, notes, and snippets.

@cs8425
cs8425 / gist:7869055
Created December 9, 2013 08:25
M-JPG http header
http://stackoverflow.com/questions/2060953/httpwebresponse-with-mjpeg-and-multipart-x-mixed-replace-boundary-myboundary
var BOUNDARY = '----' + Math.random().toString(16).substring(2);
header("Cache-Control: no-cache");
header("Cache-Control: private");
header("Pragma: no-cache");
header("Content-type: multipart/x-mixed-replace; boundary=$boundary");
============================
HTTP/1.1 200 OK
Content-Type: multipart/x-mixed-replace; boundary=--myboundary
@cs8425
cs8425 / gist:2383629
Created April 14, 2012 11:10
gate2to4
module xbox( a, o );
input [1:0]a;
output [3:0]o;
assign o = 4'b0001 << a ;
endmodule
@cs8425
cs8425 / mux4.v
Created April 14, 2012 11:08
mux4
module mux4( d, s, y );
input [3:0]d;
input [1:0]s;
output y;
wire [3:0]d;
wire [1:0]s;
wire y;
assign y= (s == 2'b00)? d[0]: (s == 2'b01)? d[1]: (s == 2'b10)? d[2] : d[3];
@cs8425
cs8425 / gist:2383514
Created April 14, 2012 10:47
2bit_to_8LED
module led8( select, d );
input[2:0] select;
output[7:0] d;
wire[2:0] select;
reg[7:0] d;
always @( select or d )
begin