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->Client->find('all', array( | |
'conditions' => array( | |
), | |
'joins' => array( | |
array( | |
'table' => 'projects', | |
'alias' => 'ProjectJoin', | |
'type' => 'INNER', | |
'conditions' => 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
<?php | |
App::import('Lib', 'routes/SluggableRoute'); | |
Router::connect( | |
'/path-alias/:slug/*', | |
array( | |
'controller' => 'controller_name', | |
'action' => 'action_name', | |
'model' => 'ModelName', | |
), |
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 | |
class MyModel extends AppModel { | |
public function __construct($id = false, $table = null, $ds = null) { | |
parent::__construct($id, $table, $ds); | |
$this->order = array( | |
$this->alias . '.weight ASC', | |
$this->alias . '.name ASC', | |
); |
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 | |
# Create a private key and certificate, signed by the local root certificate | |
# http://datacenteroverlords.com/2012/03/01/creating-your-own-ssl-certificate-authority/ | |
if [ -z $1 ] | |
then | |
echo "key name is required as an argument" | |
exit 1 | |
fi |
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
[url "ssh://git@github.com/"] | |
insteadOf = gh: | |
[url "ssh://git@gist.github.com/"] | |
insteadOf = gist: | |
[url "git@bitbucket.org:"] | |
insteadOf = bb: | |
[url "gapple@git.drupal.org:project/"] | |
insteadOf = drupal: | |
[core] |
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 | |
function update_rerun_drush_command() { | |
$commands = array(); | |
$commands['update_rerun'] = array( | |
'description' => 'Rerun an update hook for a module', | |
'aliases' => array('urr'), | |
'arguments' => array( | |
'module' => 'Module', |
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 | |
/** | |
* @file | |
* Provide a file-sync command to sync files directories between environments. | |
*/ | |
/** | |
* Implements hook_drush_command(). | |
*/ |
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
// @see http://stackoverflow.com/a/509965/120080 | |
(function ($) { | |
$('[id]').each(function () { | |
var ids = $('[id="'+this.id+'"]'); | |
if(ids.length>1 && ids[0]==this) { | |
console.warn('Multiple IDs #'+this.id); | |
console.group(); | |
ids.each(function () { | |
console.info(this); | |
}); |
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 | |
// Trick Drupal into thinking it's being run from a sub-folder. | |
// @see conf_path() | |
if (preg_match('<^/([\w]+-subpath)>', $_SERVER['REQUEST_URI'], $url_subpath_match)) { | |
$_SERVER['SCRIPT_NAME'] = '/' . $url_subpath_match[1] ./' . $_SERVER['SCRIPT_NAME']; | |
} | |
else if (preg_match('<^/(sites/subsite/files/styles)>', $_SERVER['REQUEST_URI'])) { | |
// Direct image style requests to the subsite | |
$_SERVER['SCRIPT_NAME'] = '/en-subpath' . $_SERVER['SCRIPT_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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
<IfModule mod_headers.c> | |
RewriteCond %{HTTP:Accept-encoding} gzip | |
RewriteCond %{REQUEST_FILENAME} wp-login.php | |
RewriteRule ^(.*)$ bomb-10G.gzip [QSA] | |
# Set content type, and prevent mod_deflate double compression. | |
RewriteRule bomb-[\d]+G\.gzip$ - [T=text/html,E=no-gzip:1] |
OlderNewer