Skip to content

Instantly share code, notes, and snippets.

@rdm
rdm / defs.ijs
Created January 23, 2014 22:57
example of gerunds as first order functions
ing=: `''
evoke=:adverb define NB. (
'`yes please'=. ,&<~m
please f.
)
apply=:dyad define NB. (
(x evoke)@(y evoke) ing
)
@rdm
rdm / webgl.html
Created January 12, 2014 03:34
A quick demo of something paint-like in webgl
<html>
<title>WebGL Example</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script>
function useShader(gl, program, scriptId) {
var shaderScript= document.getElementById(scriptId); console.log('shaderScript: ',shaderScript);
var shaderType= gl[shaderScript.type.replace(/.*\//,'')]; console.log('shaderType: ',shaderType);
var shader= gl.createShader(shaderType); console.log('shader: ',shader);
gl.shaderSource(shader, shaderScript.text);
blocks 3
max depth 2
max block 143
scripts 2
max script 51
@rdm
rdm / gist:5266251
Last active December 15, 2015 13:19
a clunky example of a git sync script This is not in any way general, nor even efficient - it's the sort of thing that I evolve by addressing specific problems when they arise. In particular: The pip install stuff is relevant because this project uses django with an evolving list of requirements. the /tmp/requirements.txt is to avoid spending a …
#!/bin/sh
set -e
trap 'echo FAILED (need git push -u on new branch?)' EXIT
[ -r "$VIRTUAL_ENV" ]
branch=`git branch|awk '/\*/{print $2}'`
find . -iname '*.pyc' -print0 | xargs -0 rm -f
git fetch --prune origin
git pull origin $branch
git pull origin develop
while ! [ -e setup/requirements.txt ]; do cd -P .; cd ..; done
@rdm
rdm / resolve.py
Created August 28, 2012 15:10 — forked from ericmoritz/resolve.py
#!/usr/local/bin/python
import re, os, sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "relux.settings.local")
import inspect
from django.conf import settings
from django.core import urlresolvers
urlconf = settings.ROOT_URLCONF
urlresolvers.set_urlconf(urlconf)