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 / gameengines.md
Created January 6, 2011 18:07
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out the [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]] and [[Scene Graphs]].

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n
@bebraw
bebraw / assert.js
Created May 1, 2011 08:04
Chaining assert statement for JavaScript
var assert = function(stmt) {
var methods = {
equals: {
error: function(val) {
return val + ' did not equal ' + stmt + '!'
},
method: function(val) {
return val == stmt;
}
},
@bebraw
bebraw / .babelrc
Created September 4, 2015 06:28
How to configure Babel for production/development?
{
"env": {
"build": {
"stage": 2
}
}
}
import subprocess
import sys
def convert(source, from_format, to_format):
# original version: http://osiux.com/html-to-restructured-text-in-python-using-pandoc
# supported formats at http://johnmacfarlane.net/pandoc/
# raises OSError if pandoc is not found!
p = subprocess.Popen(['pandoc', '--from=' + from_format, '--to=' + to_format],
stdin=subprocess.PIPE, stdout=subprocess.PIPE
)
function process(canvas, func) {
function setPixel(imageData, x, y, rgba) {
var index = (x + y * imageData.width) * 4;
for (var i = 0; i < 4; i++) {
imageData.data[index + i] = rgba[i] * 255;
}
}
var ctx = canvas.getContext("2d");
"use strict";
const Mustache = require("mustache");
const path = require("path");
/**
* This plugin is used to generate an html file from a mustache template.
* @param {object} options
* - enabled {boolean} whether plugin is enabled
* - outputFile {string} the relative path to the html file result
import pyeliza
class Eliza:
aliases = 'eliza'
description = 'Virtual therapist'
_therapist = pyeliza.eliza()
def execute(self, expression, context):
'''
>>> from mock import Mock
@bebraw
bebraw / tatiana-mac-speaker-rider.md
Created August 5, 2019 15:56 — forked from tatianamac/tatiana-mac-speaker-rider.md
Tatiana Mac's Speaker Rider

Speaker Rider

by Tatiana Mac

Before I'll agree to a speaking event, I try to do as much research I can around the event to ensure it aligns with my ethos. I want to share this in case it's helpful to any other speakers.

👐 Speaking comes with immense privilege. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most marginalised and suppressed communities.

😫 I wish I didn't have to, but this is long because I provide a lot of explanations for those of you who never had to consider these things. And I will be honest, most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.

1️⃣ All of these are based on my own ethos. I don't wish to or attempt to speak on behalf of all conference speake

<html>
<head>
<title>Angular Gradient Test</title>
<script type="text/javascript" src="graphics.js"></script>
<script type="text/javascript" src="math.js"></script>
<script type="text/javascript">
function draw() {
var canvas = document.getElementById("canvas");
var halfWidth = canvas.width / 2;
/*
html-webpack-plugin-lite
Usage:
new HtmlWebpackPluginLite({
title: "Webpack demo", // Available in context
template: ({ css, js, title }) => ... html ...
}),
*/