Skip to content

Instantly share code, notes, and snippets.

View fjakobs's full-sized avatar

Fabian Jakobs fjakobs

View GitHub Profile
@fjakobs
fjakobs / qooxdoo hello world
Created October 15, 2009 07:40
Mouse Capturing
// Create a button
var button1 = new qx.ui.form.Button("First Button", "icon/22/apps/internet-web-browser.png");
// Document is the application root
var doc = this.getRoot();
// Add button to document at fixed coordinates
doc.add(button1,
{
left : 100,
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="author" content="Fabian Jakobs">
<!-- Date: 2009-10-15 -->
<style type="text/css" media="screen">
@fjakobs
fjakobs / date_serializer.js
Created January 18, 2010 12:15
Date serializer [qx]
var obj = { date: new Date(123)}
Date.prototype.toJSON = function() {
return { $$date$$: this.getTime() }
}
var json = qx.lang.Json.stringify(obj);
console.log(json)
@fjakobs
fjakobs / gist:285751
Created January 25, 2010 09:45
Bug #3336 [qx]
We couldn’t find that file to show.
@fjakobs
fjakobs / cached-script.php
Created March 12, 2010 10:56
IE script loading bug
<?php
header("Content-Type: text/javascript");
header("Cache-Control: private, max-age=34560000", TRUE);
?>
window.SCRIPT_LOADED = true;
if (window.BREAK) debugger;
@fjakobs
fjakobs / array_performance.html
Created March 16, 2010 09:26
array performance
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Array Performance</title>
<meta name="author" content="Martin Wittemann">
<meta name="author" content="Fabian Jakobs">
<!-- Date: 2010-03-09 -->
@fjakobs
fjakobs / index.html
Created March 23, 2010 10:39
bookmarklet
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Container</title>
<meta name="author" content="Fabian Jakobs">
<!-- Date: 2008-12-18 -->
</head>
@fjakobs
fjakobs / gist:443774
Created June 18, 2010 15:22
rmTree for node
var rmTreeSync = exports.rmTreeSync = function(path) {
if (!existsSync(path)) return;
var files = fs.readdirSync(path);
if (!files.length) {
fs.rmdirSync(path);
return;
} else {
files.forEach(function(file) {
var fullName = p.join(path, file);
if (!require.def) require.def = require("requireJS-node")(module);
require.def("project/foo", ["project/bar"], function(oop) {
// ...
});
@fjakobs
fjakobs / main.js
Created September 29, 2010 18:43
requireJS loader for node.js
var Script = process.binding('evals').Script;
require.registerExtension(".rjs", function(content) {
require.def = function(name, deps, callback) {
if (!callback) {
callback = deps;
deps = [];
}
var modules = deps.map(function(dep) {