Public Gists by tobie

Gravatar
Sun Nov 08 09:48:15 -0800 2009
1
2
3
testEmile: function(testcase) {
  var element = document.getElementById('test_basic');
  testcase.assertEqual('0px', element.style.left);
gist: 225259 Installing Rhino on Mac OSX
Gravatar
Tue Nov 03 09:35:27 -0800 2009
1
2
3
mkdir ~/Desktop/src/
cd ~/Desktop/src/
curl -O ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_7R2.zip
Gravatar
Fri Oct 23 06:59:28 -0700 2009
1
2
3
Prototype.Selector.select(<String: selector>[, <Node: scope=document>]) -> [Element...]
Prototype.Selector.match(<Node: element>, <String: selector>) -> Boolean
Prototype.Selector.filter(<Iterable: elements>, <String: selector>) -> [Element...]
Gravatar
Wed Oct 07 05:58:20 -0700 2009
1
2
3
// Untested. Requires Prototype >= 1.6
//
// Copyright (c) 2009 Tobie Langel
Gravatar
Wed Oct 07 05:58:19 -0700 2009
1
2
3
// Untested. Requires Prototype >= 1.6
//
// Copyright (c) 2009 Tobie Langel
Gravatar
Tue Oct 06 09:53:55 -0700 2009
1
2
3
// Untested. Requires Prototype >= 1.6
//
// Copyright (c) 2009 Tobie Langel
Gravatar
Mon Aug 10 10:27:23 -0700 2009
1
2
3
<!doctype html>
<html lang="en">
<head>
Gravatar
Wed Jul 29 06:24:24 -0700 2009
1
2
3
document.observe('click', function(event) {
  var element = event.findElement('a.quickdetails');
  if (!element) { return; }
Gravatar
Sat Jul 11 17:57:21 -0700 2009
1
2
3
/* jsonp.js for Protototype
 *
 * Copyright (c) 2009 Tobie Langel (http://tobielangel.com)
gist: 81118 SpiderMonkey's uneval for c...
Gravatar
Wed Mar 18 06:35:51 -0700 2009
1
2
3
function repr(v) {
  print(uneval(v))
}
gist: 78424 Python repr of common types
Gravatar
Thu Mar 12 21:02:48 -0700 2009
1
2
3
repr(False)
#-> False
 
gist: 78355 Ruby p() of common types
Gravatar
Thu Mar 12 16:33:04 -0700 2009
1
2
3
p(nil)
#-> nil
 
Gravatar
Sun Jan 11 17:26:41 -0800 2009
1
2
3
(function() {
  var toString = Object.prototype.toString;
 
Gravatar
Wed Jan 07 07:56:36 -0800 2009
1
2
3
Object.extend = Object.extend.wrap(function(proceed, destination, source, safe) {
  if (!safe) return proceed(destination, source);
  for (var property in source) {
Gravatar
Sun Jan 04 06:15:59 -0800 2009
1
2
3
/*
Simpler, more robust super keyword for Prototype.
 
Gravatar
Wed Dec 10 18:24:47 -0800 2008
1
2
3
var ES_3_1_STRICT_MODE = (function(){
  try {
    arguments.callee;
Gravatar
Wed Dec 10 18:17:19 -0800 2008
1
2
3
 function concat() {
    var array = slice.call(this, 0), item;
    for (var i = 0, length = arguments.length; i < length; i++) {
Gravatar
Fri Oct 10 06:54:08 -0700 2008
1
2
3
function Point(x, y) {
  function getX() {
    return x;
Gravatar
Mon Aug 11 08:09:59 -0700 2008
1
2
3
var element = document.getElementById('foo');
try {
  element.removeAttribute.apply(element, ['title']);
Gravatar
Mon Aug 11 05:52:25 -0700 2008
1
2
3
Element.addMethods({
  clone: function(element) {
    var clone = $(element).cloneNode(true);