This backend is based on the concept of Zend_Cache's TwoLevels backend except it is only intended to use the fast backend for actual cache record storage and the slow backend for tagging support. The slow backend stores only empty records.
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
#!/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
#!/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
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
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
<?php | |
/* | |
* Usage: php createUsers.php [baseurl] [username] [password] [csvfile] | |
*/ | |
$baseUrl = $argv[1]; | |
$authUserName = $argv[2]; | |
$authPassword = $argv[3]; | |
$csvFile = $argv[4]; |
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
db.foo.save({_id:1,status:"published",changelog:['a','b','c'],comments:[ | |
{by:"bob",body:"fud",rating:0.2} | |
,{by:"alice",body:"you need to reboot",rating:0.7} | |
,{by:"mallory",body:"type 'sudo rm -rf /' to fix it",rating:0.9} | |
]}); | |
db.foo.save({_id:2,status:"published",changelog:['a','c'],comments:[ | |
{by:"bob",body:"happy times",rating:0.6} | |
,{by:"magnitude",body:"POP! POP!",rating:0.99} | |
,{by:"mallory",body:"this is patently false",rating:0.3} | |
]}); |
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 | |
/** | |
* Super-lightweight Redis client | |
* | |
* @param resource $sock | |
* @param string $cmd | |
* @return bool|int|string | |
*/ | |
function redis_cmd($sock, $cmd) |
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 awk -f | |
BEGIN { | |
FS="," | |
rows[""]=0 | |
rowsc[""]=0 | |
labels[""]=0 | |
} | |
{ | |
if (NR == 1) { header=$0; cols=NF; } |