Skip to content

Instantly share code, notes, and snippets.

anselm anselm

View GitHub Profile
View gist:2e9e45211b90abe30284f233386e5b62
### Keybase proof
I hereby claim:
* I am anselm on github.
* I am anselmhook (https://keybase.io/anselmhook) on keybase.
* I have a public key whose fingerprint is 47D8 81E1 7770 619D F180 C796 238F A172 01DE BFE1
To claim this, I am signing this object:
@anselm
anselm / categories.txt
Created Jun 6, 2018
Categories of AR Apps
View categories.txt
- categories
- support
- hardware
- 3d trackers
- rendering
- animation
- datastore
- cloud service
- account management
View gps_sound_game.html
<!-- see the writeup at https://medium.com/@anselm/playing-with-gps-spatialized-web-audio-f86e45d31d10 -->
<canvas id="mycanvas" width=512 height=512>
</canvas>
<script>
// a small database of all the objects
let artifacts = [
@anselm
anselm / import_some_data_to_parse.js
Created Oct 23, 2016
A bit of code to import some annoying data to parse
View import_some_data_to_parse.js
const http = require('http');
function pushme(mydata,mytable) {
var postData = JSON.stringify( mydata );
var options = {
hostname: 'localhost',
port: 1337,
path: '/parse/classes/'+mytable,
View HalfCylinder.m
//
// a snippet for for iOS scenekit
// generate an open half cylinder in such a way that the texture stretches from 0->1 over the surface
// the idea is that this could be used for a 180' pano
//
- (SCNGeometry*) createCurve:(int)resolution width:(float)radius {
if(resolution<1)return nil;
View early_out.mm
A small bit of kvetching...
Imagine in Shakespeare if a sonnet didn't hew towards the core message but instead had you hold all the loose blocks of marble in working memory.
My mistresses eyes are like the sun in no way, but in the way they are not like the sun so is her hair like wires, and in the way they are like the sun there is nothing further to remark upon.
By a similar quality it bugs me when early out conditions are deferred to the end of a code block. For me this is probaby a carry over from working in assembler. In early programming environments there was both a computational and cognitive cost to jumping around a block of other code prior to ceding control. Modern compilers optimize this away but there's still a cognitive burden to having to hold a larger model in mind. If you think of a piece of code as a tree of branching possibilities then it makes sense to whittle away those branches as quickly as possible so that you're left with the minimum functionality needed to close out the responsib
@anselm
anselm / migrate.rb
Created Nov 18, 2015
Converts Jim Hightower's site from drupal to wordpress without having to actually log into the drupal site. Makes images and wires podcast media types up etc.
View migrate.rb
require 'date'
require 'net/http'
require 'uri'
require 'open-uri'
require 'rubypress'
require 'mime'
require 'mime/types'
require 'imgkit'
# goals
@anselm
anselm / Tubular.cs
Last active Feb 25, 2016
a unity3d c# port of the threejs tube renderer
View Tubular.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
/**
* @author zz85 / http://www.lab4games.net/zz85/blog
* Extensible curve object
**/
@anselm
anselm / publish.php
Created May 19, 2015
A small app that allows a user to create an anonymous document with a unique ID. The document is discoverable by the ID. An MD5 hash is used so that the chances of collision are low and the chances of random discovery are low. The input is sanitized to prevent attacks on other users and the path is also sanitized to prevent browsing a poorly sec…
View publish.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Web Notes</title>
<!-- Pull in Bootstrap to style things up a bit -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
@anselm
anselm / gist:f5b1c2dc0117757a1141
Created May 13, 2015
send mouse positions to gcode using node js
View gist:f5b1c2dc0117757a1141
/*
This is a node.js application. It relies on "npm serialport".
Save it as penwriter.js
Run it using
node penwriter.js
You can’t perform that action at this time.