Archive for the ‘Code’ category

20120121 A hack to parse RSS feeds with php

Just happened to assemble this script hack recently, out of the requirement for a quick’n’dirty feed parsing feature: $feed_contents = file_get_contents($feed_url); $xml = simplexml_load_string($feed_contents, LIBXML_NOCDATA); $feed_array = json_decode(json_encode($xml)); print_r($feed_array); // Surprise!! Now this evidently is not SimplePie or Magpie RSS or whatever feed reader library tickles your fancy*, but assuming the feed will never be [...]

20111111 Aduki shader

Got this toying with Mr.doob’s GLSL Sandbox. See it live. It’s my first shader ever!! :D Here’s the code: #ifdef GL_ES precision highp float; #endif uniform float time; uniform vec2 resolution; void main( void ) {         vec2 position = gl_FragCoord.xy / resolution.xy;         float color = 0.0;   [...]

20111016 HTML5′s custom attributes minigotcha

I was trying to set a Javascript Object as the value for a custom attribute, but I was just getting “[Object object]” as the value when reading it back. This is actually the toString() version of my object, and was also my ‘fault’ for not reading the specs (or for daring to attempt something risky!), [...]

20110819 Line spacing inconsistencies when pasting to Firefox from gedit

I was adding some productions to escena.org when I noticed something strange about the way the info section of the latest productions was looking. I was slightly distracted by the excitement of watching all those intros and demos that I hadn’t heard before about, so it took me a while to notice what it was [...]

20110718 “insufficient permissions for device”

Yes, another of those note-to-self posts, since each time I try to connect a new device to the computer I’ve already forgotten how this is done :-)