Tag: Old code

Old code: CSS rules on the fly from JavaScript (2006)

Again, some old code I'm not using anymore since I switched to jQuery but that might be useful for someone: /* * Public Domain * Created by Toni Corvera <outlyer@outlyer.net> in September, 2006 * * Creates a new CSS ruleset, should work with multiple rules correctly * e.g.: * loadCssRules('body{font-family:sans-serif;}a:link{color:red;}'); */ // void function loadCssRules(String […]

Read More

Old code: DOM extensions (2004-2006)

Nowadays I'm using something more powerful like jQuery or base2.DOM, but if you don't, these might prove useful. /* * Copyright 2004-2006 Toni Corvera <outlyer@outlyer.net> * * License: http://www.gnu.org/copyleft/lgpl.html LGPL * * Extra DOM-like methods (Note that at the time of writing they can't be * bound to the Document prototype, so they are global […]

Read More

Old code: JavaScript x-browser arrays (2005, 2010)

Last update: 2010-12-09 This block of code is deprecated, I'm only keeping it for archival purposes, see below for a more up-to-date equivalent /* * Public Domain * * Created by Toni Corvera <outlyer@outlyer.net>, 2005 * * Defines Array.find, and Array.merge */ // int Array.find(Object) if (!Array.indexOf) {/*IE has no indexOf*/ Array.prototype.find = function(what) { […]

Read More

Script: video identification (Bash)

This script displays mplayer's information/identification lines of a multimedia file. Nowadays I prefer to use an undocumented feature of vcs (see below) #!/bin/bash # This script displays mplayer's information/identification lines of a multimedia file # Put in the public domain. <http://w.corvera.eu/2007/11/shell-vidid/> vididf() { mplayer -identify -frames 0 -ao null -vo null "$1" 2>/dev/null | grep […]

Read More