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
PUT /_river/jdbc_river_1/_meta | |
{ | |
"type" : "jdbc", | |
"jdbc" : { | |
"url": "jdbc:mysql://localhost:3306/yourDb", | |
"user": "login", | |
"password": "pass", | |
"sql" : "SELECT * FROM Transactions WHERE user_id = 1", | |
"index" : "my_jdbc_index", | |
"type" : "my_jdbc_type", |
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 | |
use lithium\core\Libraries; | |
Libraries::applyFilter('instance', function($self, $params, $chain) { | |
$data = $chain->next($self, $params, $chain); | |
if (isset($params['options']['model'])) { | |
$data->applyFilter('save', function() { | |
// .... |
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
<VirtualHost *:80> | |
ServerName 10.0.0.10 | |
# Set url to proxy | |
ProxyPass / http://hosts.domain.dev/ | |
ProxyPassReverse / http://hosts.domain.dev/ | |
# Set location | |
<location /> | |
# Set url |
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 | |
namespace app\extensions\action; | |
/** | |
* Observer for the Observer pattern. When a subject sends a notification for an event, | |
* the registered listeners can act upon it. | |
* | |
* @author hdonner | |
* |
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 | |
//error_reporting (0); | |
$arr = array | |
( | |
0=> array | |
( | |
'id' => 1, | |
'parent' => 0, | |
'status' => 2, | |
'slug' => 'clothes', |
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 AgBorkowski <[email protected]> | |
* @link http://blog.aeonmedia.eu | |
*/ | |
/** | |
* Locales | |
* | |
* Adds globalization specific settings to the environment. The settings for | |
* the current locale, time zone and currency are kept as environment settings. |
Author: Casey Duncan @iamnotcasey
This Javascript constructor with inheritance pattern is designed as a lightweight alternative to other methods I've seen while still providing a nice abstraction as a 13 line function that can be easily inlined into your code.
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 | |
//config/bootstrap/cache.php | |
use lithium\storage\Cache; | |
Cache::config(array( | |
'local' => array( | |
'adapter' => 'Apc' | |
), |
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 | |
// somewhere in config/bootstrap | |
Dispatcher::config(array('rules' => array( | |
'admin' => array( | |
'action' => 'admin_{:action}' | |
) | |
))); | |
// app/classes/PostsController.php |