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
<snippet> | |
<content><![CDATA[ | |
$this->Html->link(__('${1:Link name}'), array('controller' => '${2:Controller}', 'action' => '${3:action}')) | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>link</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.php</scope> | |
</snippet> |
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
function update_git_repo() { | |
GIT_DIR=$1 | |
GIT_REMOTE=$2 | |
GIT_BRANCH=${3:-master} | |
if [ ! -d $GIT_DIR ]; then | |
CURRENT_SHA="" | |
git clone --depth 1 $GIT_REMOTE $GIT_DIR -b $GIT_BRANCH | |
else | |
CURRENT_REMOTE=$(cd $GIT_DIR && git config --get remote.origin.url || true) |
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/sh | |
curl "http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.23-osx10.9-x86_64.tar.gz" -L -o "mysql-5.6.23-osx10.9-x86_64.tar.gz" | |
tar xfvz mysql-5.6* | |
echo "stopping mamp" | |
sudo /Applications/MAMP/bin/stop.sh | |
sudo killall httpd mysqld | |
echo "creating backup" |
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/sh | |
cd .. | |
GIT_DIR='.git' | |
umask 002 && git reset --hard | |
# Set 'receive.denyCurrentBranch' configuration variable to 'ignore' or 'warn' in the remote repository to allow pushing into | |
# chmod +x .git/hooks/post-receive |
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
<div class="pm-widget-calendar"></div> | |
<script> | |
var pm_widget_calendar = { | |
limit : 10, | |
user_id : 1, | |
include_location : false | |
}; | |
</script> | |
<script src="http://cdn.planamatch.com/js/pm.calendar.widget.min.js"></script> |
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
/* | |
Extended Bootstrap Typeahead | |
Based on an answer on stackexchange.com | |
http://stackoverflow.com/a/14959406/1065537 | |
*/ | |
/* Enhances the autocomplete function */ | |
$('.autocomplete').typeahead({ | |
source: function (query, process) { | |
return $.ajax({ |
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 | |
/** | |
* GeoBehavior handles a set of operations generaly needed when working with coordinates | |
* | |
* @source https://gist.github.com/csrui/6173911 | |
* @url http://book.cakephp.org/2.0/en/Models/behaviors.html | |
**/ | |
class GeoBehavior extends ModelBehavior { | |
public $settings = 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 | |
/** | |
* MetaBehavior handles a set of fields like meta information for a given model row | |
* | |
* @source https://gist.github.com/csrui/6240411 | |
* @url http://book.cakephp.org/2.0/en/Models/behaviors.html | |
**/ | |
class MetaBehavior extends ModelBehavior { | |
public $settings = 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 | |
/** | |
* Shell to reset / create a default admin user | |
* | |
* @source https://gist.github.com/csrui/6279811 | |
* @url http://book.cakephp.org/2.0/en/console-and-shells.html | |
**/ | |
class UserShell extends AppShell { | |
public $uses = array('User'); |
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
public function getLastQuery() { | |
$dbo = $this->getDatasource(); | |
$logs = $dbo->getLog(); | |
$lastLog = end($logs['log']); | |
return $lastLog['query']; | |
} |
OlderNewer