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 / 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
@bebraw
bebraw / index.js
Created April 24, 2012 18:16
Node form API demo
var eventForm = form({
title: type.str({required: true}),
location: type.str(),
description: type.longStr({required: true}),
range: type.dateRange({onlyFuture: true, required: true}),
author: type.str({required: true}),
email: type.str() // email instead?
});
index.get = function(req, res) {
@bebraw
bebraw / blogspot_to_jekyll.rb
Created April 23, 2012 14:39 — forked from kennym/blogspot_to_jekyll.rb
Migrate your blogger blog posts to jekyll.
#!/usr/bin/env ruby
#
# Convert blogger (blogspot) posts to jekyll posts
#
# Basic Usage
# -----------
#
# ./blogger_to_jekyll.rb feed_url
#
# where `feed_url` can have the following format:
@bebraw
bebraw / voxels.py
Created April 11, 2012 15:18
Just some custom voxel shiz in Blender 2.62
from functools import partial
from math import hypot
import itertools
import bpy
# http://blenderpythonscripts.wordpress.com/2011/04/24/cursor-control-0-6-0/
def space():
area = None
for area in bpy.data.window_managers[0].windows[0].screen.areas:
@bebraw
bebraw / basic_tests.js
Created March 29, 2012 13:42
suite.js examples
var suite = require('suite.js');
var t = require('./ghw').transformers;
// regular tests, just kv-pairs
suite(matchToHTML(t.bracket_pipe_link), {
'[[foo|bar]]': '<a href="bar.html">foo</a>',
'[[foo|bar bar]]': '<a href="bar-bar.html">foo</a>',
'[[a|b]] [[b|a]]': '<a href="b.html">a</a> <a href="a.html">b</a>',
'[[a|http://b]]': '<a href="http://b">a</a>',
'[[a|https://b]]': '<a href="https://b">a</a>',
@bebraw
bebraw / generator.js
Created March 23, 2012 12:04
Generators in JavaScript
function generator(valueCb) {
return function() {
var i = 0;
return {
next: function() {
var ret = valueCb(i);
i++;
return ret;
@bebraw
bebraw / navigation.html
Created March 14, 2012 07:45
Django navigation pattern
<!-- Use {% include "includes/navigation.html" with items=navi %} -->
<ul class="nav">
{% for item in items %}
<li class="{{ item.status }}">
<a href="{{ item.url }}">{{ item.name }}</a>
</li>
{% endfor %}
</ul>
// Viitenumeron muodostaja JavaScriptillä
// (c) Kimmo Surakka <kusti@cs.tut.fi>, 1998
// Koodia saa käyttää vapaasti muuttamattomana,
// tätä tekijänoikeusilmoitusta ei saa poistaa.
//
// Muokattu Kimmo Surakan luvalla, nyt muodostaa sarjan viitenumeroita.
// (c) Jori Mäntysalo <jori.mantysalo@uta.fi>, 2004
//
function teeViite(memberId, invoiceId) {
pohja = '' + (memberId * 1000 + invoiceId);