This file contains hidden or 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
public function getNextJob() | |
{ | |
$result = $this->_getWriteAdapter()->command(array( | |
'findAndModify' => $this->_collectionName, | |
'query' => array( | |
'status' => Cm_Mongo_Model_Job::STATUS_READY, | |
'execute_at' => array('$lte' => new MongoDate), | |
), | |
'sort' => array( | |
'priority' => 1, |
This file contains hidden or 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
Mage::getSingleton('index/indexer')->processEntityAction($entity, $entityType, $eventType) | |
'index/indexer'->logEvent($entity, $entityType, $eventType) | |
If indexer is locked, nothing happens | |
Creates a new 'index/event' instance, sets entity, type, data object, and primary key | |
Runs 'register' method of each 'index/process' which loads the indexer based on the xml config from 'global/index/indexer/<INDEXER>/model' | |
If event matches indexer using matchEvent method: (checks if the appropriate key/value is in indexer's _matchedEntities property) | |
Sets the event's namespace to the name of the indexer class | |
Calls the indexer's register method which matches the event again and calls the abstract method _registerEvent($event) | |
The indexer implementation now needs to add data to the eventusing addNewData | |
Adds the process id of the process to the event |
This file contains hidden or 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 | |
# | |
# see https://github.com/kahseng/redmine_gitolite_hook/blob/master/README.rdoc | |
# | |
# The "post-receive" script is run after receive-pack has accepted a pack | |
# and the repository has been updated. It is passed arguments in through | |
# stdin in the form | |
# <oldrev> <newrev> <refname> | |
# For example: | |
# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master |
This file contains hidden or 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/perl -w | |
# | |
## Copyright (C) 2011 Colin Mollenhour <http://colin.mollenhour.com/> | |
## | |
## This program is free software; you can redistribute it and/or | |
## modify it under the terms of the GNU General Public License | |
## as published by the Free Software Foundation; version 2 dated June, | |
## 1991. | |
## |
This file contains hidden or 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
<!-- this is a child node of config/global --> | |
<cache> | |
<backend>Zend_Cache_Backend_Redis</backend> | |
<backend_options> | |
<server>127.0.0.1</server> | |
<port>6379</port> | |
<database>2</database> | |
<use_redisent>0</use_redisent> <!-- 0 for phpredis, 1 for redisent --> | |
<automatic_cleaning_factor>20000</automatic_cleaning_factor> <!-- optional, 20000 is the default, 0 disables auto clean --> | |
</backend_options> |
This file contains hidden or 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 | |
* | |
*/ |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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` |