Skip to content

Instantly share code, notes, and snippets.

View bebraw's full-sized avatar

Juho Vepsäläinen bebraw

View GitHub Profile
@bebraw
bebraw / mocha.js
Created November 21, 2012 07:21
Mocha vs. suite.js
// https://github.com/visionmedia/mocha
var assert = require("assert");
describe('Array', function(){
describe('#indexOf()', function(){
it('should return -1 when the value is not present', function(){
assert.equal(-1, [1,2,3].indexOf(5));
assert.equal(-1, [1,2,3].indexOf(0));
})
})
@bebraw
bebraw / Bugira.user.js
Created October 3, 2012 19:52
Bugira user script (expects jQuery to be found)
// ==UserScript==
// @name Bugira Script
// @namespace http://use.i.E.your.homepage/
// @version 0.55
// @description injects bugira script
// @match http://jswiki.codegyre.com/*
// @copyright 2012+, You
// ==/UserScript==
// http://stackoverflow.com/questions/2246901/how-can-i-use-jquery-in-greasemonkey-scripts-in-google-chrome
@bebraw
bebraw / my_effect.c
Created September 25, 2012 20:43
Custom Data Specification
struct {
uint8_t fac;
uint8_t fac2;
} params;
struct {
xyz_t xyz[10];
} vars;
... // effect def etc.
http://designinghypermediaapis.com/
http://www.udacity.com/overview/Course/ep245/CourseRev/1
http://www.ashmaurya.com/
http://jswiki.org/
@bebraw
bebraw / assembly.lss
Created September 20, 2012 15:23
commit id: 10e193a45040acf826aa9b6e15382410baccfe9d
build/release/firmware.elf: tiedostomuoto elf32-avr
Lohkot:
Ind Nimi Koko VirMuisOs LatMuisOs TiedSiir Tasaus
0 .data 00000010 00800100 0000153a 000015ee 2**0
CONTENTS, ALLOC, LOAD, DATA
1 .text 0000153a 00000000 00000000 000000b4 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .bss 0000066f 00800110 00800110 000015fe 2**0
@bebraw
bebraw / licensify.py
Created September 13, 2012 15:55
Tiny licensifier script
#!/usr/bin/env python
import os
def walk(path, extensions, cb):
path = os.path.abspath(path)
for f in os.listdir(path):
fp = os.path.join(path, f)
p, ext = os.path.splitext(f)
@bebraw
bebraw / fx.js
Created July 21, 2012 18:44
Quick fx description
effects = { // note that this is supposed to be ordered dict! (alternative, use list + name prop)
sine: {
init: function() {...},
exec: function() {...},
},
gameOfLife: {
init: function() {...},
exec: function() {...},
accumulate: true // defaults to false
},
@bebraw
bebraw / data.json
Created July 10, 2012 19:44
Data desc
{
meta: {
frame_rate: <Int, [0,[>
},
frames: [
[<Float, [0, 1]>],
]
}
@bebraw
bebraw / Canvas2ImagePlugin.js
Created July 4, 2012 10:09
Canvas2ImagePlugin.js fork
//
// Canvas2ImagePlugin.js
// Canvas2ImagePlugin PhoneGap/Cordova plugin
//
// Created by Tommy-Carlos Williams on 29/03/12.
// Copyright (c) 2012 Tommy-Carlos Williams. All rights reserved.
// MIT Licensed
//
(function(root, factory) {
@bebraw
bebraw / .vimrc
Created June 8, 2012 11:11
Just my current .vimrc.
colorscheme koehler
filetype on
filetype plugin on
"" http://mirnazim.org/writings/vim-plugins-i-use/
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
autocmd FileType html,htmldjango,jinjahtml,eruby,mako let b:closetag_html_style=1