This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# position into www/index.coffee | |
getBuffer = (url, response) -> | |
xhr = new XMLHttpRequest() | |
xhr.open 'GET', url, true | |
xhr.responseType = 'arraybuffer' | |
xhr.onload = response | |
xhr.send() | |
$ -> | |
document.body.innerHTML = "<p>hello there!</p>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
struct hello { | |
int hello; | |
}; | |
typedef struct hello hello; | |
hello* buffalo(hello* hello) { | |
hello->hello = 5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import util | |
@util.make_list | |
def mkslots(data): | |
for obj in data: | |
if isinstance(obj, Template) or obj == None: | |
yield One(obj) | |
else: | |
try: | |
g = iter(obj) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
fmt = "llHHi" | |
fmt_len = struct.calcsize(fmt) | |
class EvDev(object): | |
on_event = lambda self, timestamp, type, code, value: None | |
def __init__(self, devname, fd, id_serial, id_path_tag): | |
self.devname = devname | |
self.fd = fd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("loading bagu"); | |
var bagu = require("./build/Release/bagu"); | |
console.log("bagu loaded"); | |
console.log(bagu); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LinuxVideoContext : public IVideoContext, public node::ObjectWrap { | |
bool IsCurrent(); | |
void MakeCurrent(); | |
void SwapBuffers(); | |
void Close(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CFLAGS="-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads" | |
LDFLAGS="-L/opt/vc/lib/ -lWFC -lGLESv2 -lvcos" | |
gcc enum.c -o bin/enum $CFLAGS $LDFLAGS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = require 'fs' | |
class EvDevIO | |
constructor: (path, callback) -> | |
@buffer = new Buffer 16 | |
@view = new DataView @buffer | |
fs.open path, "r+", (err, @fd) => | |
if err then return callback(err, null) | |
@_read_loop(callback) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
import zlib | |
png_header = "89504E470D0A1A0A".decode('hex') | |
def png_chunks(file): | |
header = file.read(8) | |
assert header == png_header | |
length = 1 | |
while length > 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zip.workerScriptsPath = "lib/" | |
$ -> | |
archiveURL = 'app.zip' | |
requestBlob archiveURL, { | |
load: (blob) -> | |
new ZipReader blob, { | |
load: (entries) -> | |
console.log "loaded" | |
runModule(archiveURL, entries, {}, 'scripts/main') |
OlderNewer