// jQuery
$(document).ready(function() {
// 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
# Test URI | |
# Ignore netbeans folder | |
nbproject/* | |
# Ignore private folder | |
/app/private/* | |
!/app/private/empty | |
# Ignore packed asset files | |
/app/webroot/css/packed/* |
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 | |
/** | |
* MultivalidatableBehabior for CakePHP2 | |
* | |
* @uses ModelBehavior | |
* @author Dardo Sordi> | |
* @link http://bakery.cakephp.org/articles/dardosordi/2008/07/29/multivalidatablebehavior-using-many-validation-rulesets-per-model | |
*/ | |
class MultivalidatableBehavior extends ModelBehavior | |
{ |
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
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT HEAD~1 HEAD | xargs tar -rf ~/exports/export.tar |
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('Model', 'CakeSchema'); | |
App::import('Model', 'ConnectionManager'); | |
include_once(APP.'plugins'.DS.'pluginname'.DS.'config'.DS.'schema'.DS.'schema.php'); | |
$db = ConnectionManager::getDataSource('default'); | |
//Get all available tables | |
$tables = $db->listSources(); | |
$CakeSchema = new CakeSchema(); |
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
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
//Database connection | |
var uristring = 'mongodb://localhost/test'; | |
var mongoOptions = { }; | |
mongoose.connect(uristring, mongoOptions, function (err, res) { | |
if (err) { | |
console.log('Error when connecting to: ' + uristring + '. ' + err); |
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
/*** | |
* This gist provides a __FILE__ variable, which holds the path to the file | |
* from which the currently running source is being executed. | |
* | |
* Usage example: alert(__FILE__); | |
* | |
* Thanks to http://ejohn.org/blog/__file__-in-javascript/ on which this gist | |
* is based on. | |
* | |
* Tested in Mozilla Firefox 9, Mozilla Firefox 16, Opera 12, Chromium 18 |
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
alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist' | |
alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist' | |
alias nginx.restart='nginx.stop && nginx.start' | |
alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist" | |
alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist" | |
alias php-fpm.restart='php-fpm.stop && php-fpm.start' | |
alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist" | |
alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist" | |
alias mysql.restart='mysql.stop && mysql.start' | |
alias nginx.logs.error='tail -250f /usr/local/etc/nginx/logs/error.log' |
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
server { | |
listen 80; | |
server_name localhost; | |
root /Users/YOUR_USERNAME/Sites; | |
access_log /Library/Logs/default.access.log main; | |
location / { | |
include /usr/local/etc/nginx/conf.d/php-fpm; | |
} |
OlderNewer