This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Arian Stolwijk <http://www.aryweb.nl> | |
* @license MIT-license | |
*/ | |
/* | |
$rss = new Rss_Parser(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add an outer click Event to an Element | |
// http://cpojer.net/blog/Custom_outerClick_event (but this page doesn't exist anymore) | |
Element.Events.outerClick = { | |
base: 'click', | |
condition: function(event){ | |
event.stopPropagation(); | |
return false; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document.body).addEvent('click', 'a', function(){ | |
alert('hi'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple snippet that makes it easy to use namespaced.object.like.this | |
Function.use = function(object, fn, bind, args){ | |
var objects = Array.flatten([object]); | |
fn.apply(bind, args ? objects.concat(args) : objects); | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cleaned up version of Elements.MultiHighlight.js - http://github.com/subhaze/mootools-elements-multihighlight/blob/master/Source/Elements.MultiHighlight.js | |
/* | |
- No need for the this.each | |
- mouseoverVals and mouseoutVals are no object values of another object anymore (better minification) | |
- Set the mouseoverVals and mouseoutVals in the mouseenter event (the properties might change after the first call) | |
if (backgroundColor || foregroundColor){ ... to if (!backgroundColor && !foregroundColor) return this; | |
- applied MooTools coding style | |
*/ | |
/* | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// A class that fetches data from http://whomsy.com and checks if a domain is available | |
class Whomsy { | |
public $server = 'http://whomsy.com/api/%s'; | |
public $timeout = 5; | |
public static $AVAILABILITIES = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
$files = explode("\n", shell_exec('git ls-files')); | |
foreach ($files as $file){ | |
$file = trim(__DIR__ . '/' . $file); | |
if (!(substr($file, -4) == 'html' || substr($file, -2) == 'js')) continue; | |
$content = file_get_contents($file); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple JavaScript function to copy values from one object to another | |
Object.copy = function(from, to, keys){ | |
l = keys.length; | |
while (l--) to[keys[l]] = from[keys[l]]; | |
return to; | |
}; | |
var obj1 = {foo: 'bar', temp: 'foo', bar: 'temp'}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.implement({ | |
i: 0, | |
current: function(){ | |
return this.valid() ? this[this.i] : null; | |
}, | |
jump: function(i){ | |
if (i < 0) i = -1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A memoize function to store function results of heavy functions | |
Function.prototype.memoize = function(hashFn, bind){ | |
var memo = {}, | |
self = this; | |
if (!hashFn) hashFn = function(arg){ | |
return arg; | |
}; |
OlderNewer