Skip to content

Instantly share code, notes, and snippets.

View jbenet's full-sized avatar

Juan Benet jbenet

View GitHub Profile
@jbenet
jbenet / _includes..JB..pages_list
Created February 13, 2012 22:06
jekyll page index
{% for node in pages_list %}
{% if group == null or group == node.group %}
{% include JB/pages_list_item %}
{% endif %}
{% endfor %}
{% assign index = nil %}
{% assign group = nil %}
@jbenet
jbenet / gist:2011218
Last active October 1, 2015 14:48
Ode to Wave

In July 2009, I read about Google Wave and got pretty excited. I had also just discovered the genius of Dr. Seuss's poetry. The form to request an invite to Wave had a textarea saying "Write a message to the Google Wave team." So I did.

Too bad wave failed miserably. Perhaps another like it will come.

@jbenet, 2013-11-20

>>> from datastore import *
>>> d = DictDatastore()
>>> d.put(Key('/abcd/type:pdf'), 'pdf')
>>> d.put(Key('/abcd/type:html'), 'html')
>>> d.put(Key('/abcd/metadata'), 'metadata')
>>> list(d.query(Query(Key('/abcd/type'))))
['html', 'pdf']
>>> list(d.query(Query(Key('/abcd'))))
['metadata']
@jbenet
jbenet / gist:2348865
Created April 10, 2012 06:47
Wars of All Kinds
Wars of All Kinds - wAsted (2008)
(uses projection)
Concept: 1950s video propaganda-like comedic montage of all the different types
of wars in history. The narrator speaks to "Jimmy" and tries to recruit him.
Tech: Film projection.
Notes: Kid watching TV, TV projected behind him on screen for us to see. (Eliot
watching this? chain of spectatorship: audience > eliot > kid > projection).
@jbenet
jbenet / CanvasMatrix.js
Created June 2, 2012 01:28
Remember your e50
CanvasMatrix4=function(m){if(typeof m=='object'){if("length"in m&&m.length>=16){this.load(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]);return}else if(m instanceof CanvasMatrix4){this.load(m);return}}this.makeIdentity()};CanvasMatrix4.prototype.load=function(){if(arguments.length==1&&typeof arguments[0]=='object'){var matrix=arguments[0];if("length"in matrix&&matrix.length==16){this.m11=matrix[0];this.m12=matrix[1];this.m13=matrix[2];this.m14=matrix[3];this.m21=matrix[4];this.m22=matrix[5];this.m23=matrix[6];this.m24=matrix[7];this.m31=matrix[8];this.m32=matrix[9];this.m33=matrix[10];this.m34=matrix[11];this.m41=matrix[12];this.m42=matrix[13];this.m43=matrix[14];this.m44=matrix[15];return}if(arguments[0]instanceof CanvasMatrix4){this.m11=matrix.m11;this.m12=matrix.m12;this.m13=matrix.m13;this.m14=matrix.m14;this.m21=matrix.m21;this.m22=matrix.m22;this.m23=matrix.m23;this.m24=matrix.m24;this.m31=matrix.m31;this.m32=matrix.m32;this.m33=matrix.m33;this.m34=matrix.m34;this
Dear Bernie,
You told me you would string this guy up by the toes the last time Mohda made his stupid statement about simulating the mouse's brain.
I thought that having gone through Blue Brain so carefully, journalists would be able to recognize that what IBM reported is a scam - no where near a cat-scale brain simulation, but somehow they are totally deceived by these incredible statements.
I am absolutely shocked at this announcement. Not because it is any kind of technical feat, but because of the mass deception of the public.
1. These are point neurons (missing 99.999% of the brain; no branches; no detailed ion channels; the simplest possible equation you can imagine to simulate a neuron, totally trivial synapses; and using the STDP learning rule I discovered in this way is also is a joke).
@jbenet
jbenet / graph.json
Created July 1, 2012 01:42
Force-Directed Layout (with labels)
{"nodes":[{"name":"Myriel","group":1},{"name":"Napoleon","group":1},{"name":"Mlle.Baptistine","group":1},{"name":"Mme.Magloire","group":1},{"name":"CountessdeLo","group":1},{"name":"Geborand","group":1},{"name":"Champtercier","group":1},{"name":"Cravatte","group":1},{"name":"Count","group":1},{"name":"OldMan","group":1},{"name":"Labarre","group":2},{"name":"Valjean","group":2},{"name":"Marguerite","group":3},{"name":"Mme.deR","group":2},{"name":"Isabeau","group":2},{"name":"Gervais","group":2},{"name":"Tholomyes","group":3},{"name":"Listolier","group":3},{"name":"Fameuil","group":3},{"name":"Blacheville","group":3},{"name":"Favourite","group":3},{"name":"Dahlia","group":3},{"name":"Zephine","group":3},{"name":"Fantine","group":3},{"name":"Mme.Thenardier","group":4},{"name":"Thenardier","group":4},{"name":"Cosette","group":5},{"name":"Javert","group":4},{"name":"Fauchelevent","group":0},{"name":"Bamatabois","group":2},{"name":"Perpetue","group":3},{"name":"Simplice","group":2},{"name":"Scaufflaire","group":2},

countdown!

Quick js countdown! Just link people to

http://bl.ocks.org/d/3123711/#<utc unix timestamp>

And voila!

@jbenet
jbenet / github-notifications.md
Created August 26, 2012 11:48
github notifications -> monotony -> growl
"There comes a time in a young man's life when "haha, whoopsie, I'm a kid who
is not responsible for his own decisions" is no longer sufficient for a
do-over. I am not sure when that is, but if you're running a business, well,
welcome to being an adult."
~patio11 (http://news.ycombinator.com/item?id=1688943)