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
/* | |
Author: Colin Mollenhour | |
Delegator - An event delegation class for Prototype. | |
Supports CSS selectors or binary functions and mouseenter and mouseleave emulation. | |
Usage: | |
1. Create a 'Delegator' instance passing the event type to delegate. You cannot change the event type later. | |
2. Add some rules to the Delegator instance using "add". Rules can be added or removed at any point. |
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
class Kohana extends Kohana_Core { | |
// Se the active component in the Router | |
public static $component; | |
/** | |
* A wrapper for Kohana::find_file, this is to be used where the component path should be searched first | |
*/ | |
public static function find_file($directory, $filename, $required = FALSE, $ext = 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
#!/bin/bash | |
# Module Manager | |
# Version 1.0.1 | |
# System Requirements: | |
# - bash | |
# - web server must follow symlinks | |
# - The following utilities must be locatable in your $PATH | |
# svn, grep (POSIX), find, ln, sed, cp, basename, dirname |
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 | |
$iterations = 100000; | |
echo "Iterations: $iterations\n"; | |
class Test { | |
public function nothing0(){} | |
public function nothing1($arg1){} | |
public function nothing2($arg1,$arg2){} | |
public function nothing3($arg1,$arg2,$arg3){} |
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
#!/bin/bash | |
# | |
# Colin Mollenhour | |
# | |
# Run this from a cron job to be notified when a file is changed. | |
# Use the --append-new option to append new content to the notification email. | |
# | |
# Examples: | |
# | |
# # File in a directory changed? (recursive) |
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
#!/bin/bash | |
# Author: Colin Mollenhour | |
# | |
# Usage: Run from the webroot, .htaccess-combined will be created. | |
dest='.htaccess-combined' | |
pwd=`pwd` | |
echo -n "" > $dest | |
while read -r file; do | |
loc=`dirname $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
Plotter = {}; | |
Plotter.HOVER_SCALE = 1.5; | |
Plotter.EVENT_CORNER_RADIUS = 5; | |
Raphael.fn.gb = {}; | |
Raphael.fn.gb.event = function(event,x,y,w,h){ | |
console.debug('event', event, x,y,w,h); | |
var set = this.set(); | |
set.rect = this.rect(x,y,w,h,5).attr({ | |
fill:'red', |
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
/** | |
* Author: Colin Mollenhour | |
* Description: Wraps Raphael primitives with a set consisting of a primitive and an invisible | |
* clone used for handling mouse events. | |
* Access the overlay element and reset its opacity with: overlay() | |
* Access the set within overlay event handlers with: this.set | |
*/ | |
Raphael.fn.mouseable = function(){ | |
var args = Array.prototype.slice.call(arguments); | |
var type = args.shift(); |
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 defined('SYSPATH') OR die('No direct access allowed.'); | |
/** | |
* Mongo Auth driver. Adapted from Kohana_Auth_ORM. | |
*/ | |
class Auth_Mongo extends Auth { | |
/** | |
* Checks if a session is active. | |
* | |
* @param string role name |
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 | |
/* This script generates a mapping of factory methods/parameters to the resulting class | |
* names in such a way that PhpStorm 6.0.1 can use for autocompletion and chaining. | |
* | |
* Example: | |
* cd [magento root] | |
* php ~/makePhpstormMap.php > .phpstorm.meta.php | |
* | |
*/ |
OlderNewer