Skip to content

Instantly share code, notes, and snippets.

// http://interval.cz/clanky/pokrocile-zpracovani-udalosti-napric-platformami/
var events = new Object();
events.addListener = function(element,type,fcn)
{
if (!element.addEventListener && !element.attachEvent) return false;
if (element.addEventListener) element.addEventListener(type,fcn,false);
else if (element.attachEvent)
{
<?php
//
// This compiler is currently in beta status.
// The code is quick and dirty, but it works as far as I know.
// Feedback welcome:
// http://arantius.com/contact.php
//
// Released under GPLv2 license.
//
// ==UserScript==
// @name Never MAAR!
// @namespace http://plurk.com/garcon
// @description Never mark all as read in Plurk accidentaly.
// @include http://plurk.com/*
// @include http://www.plurk.com/*
// ==/UserScript==
//
// Version: 20100220.01
//
# run Rhino + EnvJS in console:
env-js $ java -cp dist/env-js.jar jline.ConsoleRunner org.mozilla.javascript.tools.envjs.Main
# run Rhino + EnvJS:
env-js $ java -jar dist/env-js.jar -opt -1
history | awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}' | sort -rn | head -100
<!-- Customized Google Analytics tracking code by H1.cz - ver. 4.03 rev. 20091130 -->
<script type="text/javascript" src="/ga-set.js"></script>
<script type="text/javascript">
// <![CDATA[
var pageTracker = _ga._getTracker('UA-xxxxxx-xx');
pageTracker._trackPageview();
// ]]>
</script>
@garcon
garcon / ga.js
Created November 30, 2009 18:22
/** Original Google Analytics Tracking Code
* prettyfied by http://www.prettyprinter.de/
* 2009-11-30
*/
(function(){
var aa = "_gat", s = "_gaq", v = true, w = false, x = undefined, ba = "4.5.9", z = "length", A = "cookie", C = "location", D = "&", E = "=", F = "__utma=", H = "__utmb=", I = "__utmc=", ca = "__utmk=", K = "__utmv=", L = "__utmz=", M = "__utmx=", da = "GASO=";
var N = function(f) {
return x == f || "-" == f || "" == f
},
{
km: "medium", // cpc
ks: "source", // adwords
kc: "campaign", // vanoce2009
kk: "keyword", // {keyword}
kv: "ad variation", // {creativeid}
kn: "no override" // campaign group id
}
@garcon
garcon / Sparkline.js
Created November 20, 2009 20:40
Sparkline.js
/**
* Javascript Sparklines Library
* Written By John Resig
* http://ejohn.org/projects/jspark/
*
* This work is tri-licensed under the MPL, GPL, and LGPL:
* http://www.mozilla.org/MPL/
*
* To use, place your data points within your HTML, like so:
* <span class="sparkline">10,8,20,5...</span>
@garcon
garcon / PrettyDate.js
Created November 20, 2009 20:32
PrettyDate.js – dates in a "pretty" way
/*
* JavaScript Pretty Date
* Copyright (c) 2008 John Resig (jquery.com)
* Licensed under the MIT license.
* http://ejohn.org/files/pretty.js
*/
// Takes an ISO time and returns a string representing how
// long ago the date represents.
function prettyDate(time){