Skip to content

Instantly share code, notes, and snippets.

Avatar

Christoph Nakazawa cpojer

View GitHub Profile
View UserAgent.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>UserAgent</title>
<script src="ua.js" type="text/javascript"></script>
View gist:361474
/*
* Use the Slick Selector Engine with MooTools Core 1.2.4 by @cpojer
*
* Tested with Slick branch "develop":
* http://github.com/mootools/slick/tree/develop
*
* How to use:
* - Download Slick from github and include Slick.Parser.js and Slick.Finder.js
* - Remove Selectors.js
* - Optionally you can remove all the methods mentioned below from your mootools-core build
View gist:440783
#
# Configuration File for JavaScript Lint 0.2.6
# Developed by Matthias Miller (http://www.JavaScriptLint.com)
#
# This configuration file can be used to lint a collection of scripts, or to enable
# or disable warnings for scripts that are linted via the command line.
#
#### NOTE TO TEXTMATE BUNDLE USERS:
#### Feel free to experiment with enabling/disabling individual warnings to
View Toy.js
/*
JavaScript Implementation of the TOY CPU which we used in the
lecture RECHNERNETZE UND -ORGANISATION (Computer Networks and Organization)
More Information: http://www.cs.princeton.edu/introcs/52toy/
Instruction Set: http://www.cs.princeton.edu/introcs/53isa/
This implementation comes with a built-in boot loader.
It expects files in the following format:
line 1: CAFE
View Element.Slide.js
(function(){
var className = 'slide',
classNameIn = 'in',
key = 'slide:styles',
active = 'slide:active',
chain = 'slide:chain';
var properties = {
height: 0,
View MobileClick.js
(function(){
if (!Browser.Features.Touch) return;
var start, end, moved;
var events = {
touchstart: function(event){
moved = false;
View Element.js
// Upgrade from MooTools Core 1.2 to MooTools Core 1.3
//
// Brings compatibility for Element.set and Element.get with multipe arguments.
// Use at your own risk; if cou can - fix your code and do not use this script.
// -- @cpojer
(function(){
Element.implement({
@cpojer
cpojer / Initiatable.js
Created Feb 4, 2011
Sugar for cross-module communication without knowledge of each other.
View Initiatable.js
(function(){
this.Initiatable = new Class({
isInitiatable: true,
initiator: null,
setInitiator: function(initiator){
this.initiator = initiator || null;
View Listener.js
// Element Listener Mixin
(function(){
var setup = function(){
var element = this.toElement(),
listener = new Events,
removeEvent = listener.removeEvent;
listener.removeEvent = function(key, value){
element.removeEvent(key, value);
removeEvent.call(this, key, value);
View Listener.js
// Element Listener Mixin
(function(){
var property = '$listener';
var setup = function(element){
var listener = new Events, removeEvent = listener.removeEvent;
listener.removeEvent = function(key, value){
removeEvent.call(this, key, value);
element.removeEvent(key, value);
};
You can’t perform that action at this time.