Skip to content

Instantly share code, notes, and snippets.

View mlogan's full-sized avatar

Mark Logan mlogan

View GitHub Profile
board = [
#0 1 2 3 4 5, 6, 7, 8
5, 3, 0, 0, 7, 0, 0, 0, 0,
0, 0, 0, 1, 9, 5, 0, 0, 0,
0, 9, 8, 0, 0, 0, 0, 6, 0,
8, 0, 0, 0, 6, 0, 0, 0, 3,
4, 0, 0, 8, 0, 3, 0, 0, 1,
7, 0, 0, 0, 2, 0, 0, 0, 6,
@mlogan
mlogan / gist:a6ef2383807231b9a94a
Created June 24, 2015 21:29
emscripten crash
error: failure to process js library "library.js": XXX missing C define _SC_PHYS_PAGES!,,
original source:
=============
//"use strict";
// An implementation of a libc for the web. Basically, implementations of
// the various standard C libraries, that can be called from compiled code,
// and work using the actual JavaScript environment.
//
// We search the Library object when there is an external function. If the
board = [
#0 1 2 3 4 5, 6, 7, 8
5, 3, 0, 0, 7, 0, 0, 0, 0,
0, 0, 0, 1, 9, 5, 0, 0, 0,
0, 9, 8, 0, 0, 0, 0, 6, 0,
8, 0, 0, 0, 6, 0, 0, 0, 3,
4, 0, 0, 8, 0, 3, 0, 0, 1,
7, 0, 0, 0, 2, 0, 0, 0, 6,
board = [
#0 1 2 3 4 5, 6, 7, 8
5, 3, 0, 0, 7, 0, 0, 0, 0,
0, 0, 0, 1, 9, 5, 0, 0, 0,
0, 9, 8, 0, 0, 0, 0, 6, 0,
8, 0, 0, 0, 6, 0, 0, 0, 3,
4, 0, 0, 8, 0, 3, 0, 0, 1,
7, 0, 0, 0, 2, 0, 0, 0, 6,
board = [
#0 1 2 3 4 5, 6, 7, 8
5, 3, 0, 0, 7, 0, 0, 0, 0,
0, 0, 0, 1, 9, 5, 0, 0, 0,
0, 9, 8, 0, 0, 0, 0, 6, 0,
8, 0, 0, 0, 6, 0, 0, 0, 3,
4, 0, 0, 8, 0, 3, 0, 0, 1,
7, 0, 0, 0, 2, 0, 0, 0, 6,
@mlogan
mlogan / gist:b90e5a6024e395f3c008
Created September 4, 2014 17:12
An interactive rebasing technique

Here's a cool rebasing technique that can save some time. I don't recommend using this if you aren't familiar with using rebase, there's probably a lot of ways to shoot yourself in the foot here.

Say you have a big pull request, with a bunch of commits, that look like: (oldest first, like in interactive rebase view, not git log --oneline view)

c129b43 Implementation of FooClass
3ffa239 Tests for FooClass:fizzle()

b3512ab Use FooClass::fizzle() to fizzle the frobnulator.

var board = [
//0 1 2 3 4 5, 6, 7, 8
5, 3, 0, 0, 7, 0, 0, 0, 0,
0, 0, 0, 1, 9, 5, 0, 0, 0,
0, 9, 8, 0, 0, 0, 0, 6, 0,
8, 0, 0, 0, 6, 0, 0, 0, 3,
4, 0, 0, 8, 0, 3, 0, 0, 1,
7, 0, 0, 0, 2, 0, 0, 0, 6,
// Generated by CoffeeScript 1.6.3
(function() {
var Box2D, b1, b2, beginContact, contactCb, contactCount, endContact, f1, f2, i, world, _createBody, _createCollider, _i, _j;
Box2D = require('./box2d');
_createCollider = function(body, id, radius) {
var fixtureDef, shape;
shape = new Box2D.b2CircleShape();
shape.set_m_radius(radius);
@mlogan
mlogan / gist:086c0b29ba5eafcd3af6
Created August 1, 2014 01:08
Reproduction for box2d.js/emscripten bug.
Box2D = require './box2d'
_createCollider = (body, id, radius) ->
shape = new Box2D.b2CircleShape()
shape.set_m_radius radius
fixtureDef = new Box2D.b2FixtureDef()
@mlogan
mlogan / gist:28c258ddccdf394e5235
Created May 28, 2014 00:28
Script to install chromium version with working web worker debugger.
#!/bin/bash
# Based on https://gist.github.com/statico/5987019
# This is the latest build corresponding to Version 34.0.1847.0 (there are many).
# The next viable build (251950) is 34.0.1848.0
LATEST=251940
CURRENT=`defaults read /Applications/Chromium.app/Contents/Info SVNRevision 2>/dev/null`
PROCESSID=`ps ux | awk '/Chromium/ && !/awk/ {print $2}'`