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(){ | |
$("#flashMessage,#authMessage").hide(); | |
// $("#flashMessage").css('left', ( $(window).width()-$("#flashMessage").outerWidth()) /2 ); | |
$("#flashMessage,#authMessage").css('top', 0).css('left',0); | |
$("#flashMessage,#authMessage").slideDown('fast'); | |
setTimeout(function(){ | |
$("#flashMessage,#authMessage").slideUp('slow') | |
},10000); | |
// $(":submit").click(function(){ | |
// $(this).closest("form").submit(); |
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
class Article extends ArticlesAppModel { | |
var $belongsTo = array( | |
'ArticlesCategory' => array( | |
'className' => 'Articles.ArticlesCategory', | |
'foreignKey' => 'articles_category_id' | |
) | |
, 'User'); | |
var $hasOne = array('Avatar' => array('className' => 'Image', 'foreignKey' => 'model_id', 'conditions' => array('Avatar.type' => 'hasOne', 'Avatar.model' => 'Article'))); | |
} |
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 | |
/** | |
* Copyright 2007-2010, Cake Development Corporation (http://cakedc.com) | |
* | |
* Licensed under The MIT License | |
* Redistributions of files must retain the above copyright notice. | |
* | |
* @copyright Copyright 2007-2010, Cake Development Corporation (http://cakedc.com) | |
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) |
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 | |
#Put `AppUsersController.php` in `app/Controller` | |
App::uses('UsersController', 'Users.Controller'); | |
class AppUsersController extends UsersController { | |
public function beforeFilter() | |
{ |
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
SELECT * | |
FROM `table` | |
WHERE `TableID` NOT IN ( | |
SELECT `table`.`TableID` | |
FROM `table` JOIN `reservation_table` | |
WHERE `reservation_table`.`TableID` = `table`.`TableID` | |
&& `reservation_table`.`DateTime` > NOW() | |
&& `reservation_table`.`DateTime` < ( NOW() + INTERVAL 2 HOUR ) | |
) |
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
protected function _getStackTrace(Exception $e) { | |
$trace = $e->getTrace(); | |
$out = array(); | |
foreach ($trace as $frame) { | |
if (isset($frame['file']) && isset($frame['line'])) { | |
if (strpos($frame['file'], 'app') !== false){ | |
$basename = '<span style = "color: green;text-transform:none;font-size:12px">' . basename($frame['file']) . '</span>'; | |
}else{ | |
$basename = basename($frame['file']); | |
} |
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
kill $(ps ax | grep 'search' | awk '{print $1}') | |
ps ax | grep 'search' | awk '{print $1}' | xargs svn add |
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
#!/usr/bin/php | |
<?php | |
$output = array(); | |
$return = 0; | |
exec('git rev-parse --verify HEAD 2> /dev/null', $output, $return); | |
exec("git diff-index --cached --name-only HEAD", $output); | |
exec("git diff-index --cached --name-only --diff-filter=D HEAD", $outputDels); | |
$filename_pattern = '/\.(php|ctp)$/'; |
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
# Fish shell | |
egrep "^export " ~/.bash_profile | while read e | |
set var (echo $e | sed -E "s/^export ([A-Z_]+)=(.*)\$/\1/") | |
set value (echo $e | sed -E "s/^export ([A-Z_]+)=(.*)\$/\2/") | |
# remove surrounding quotes if existing | |
set value (echo $value | sed -E "s/^\"(.*)\"\$/\1/") | |
if test $var = "PATH" |
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
# Fish shell | |
egrep "^export " ~/.bash_profile | while read e | |
set var (echo $e | sed -E "s/^export ([A-Z_]+)=(.*)\$/\1/") | |
set value (echo $e | sed -E "s/^export ([A-Z_]+)=(.*)\$/\2/") | |
# remove surrounding quotes if existing | |
set value (echo $value | sed -E "s/^\"(.*)\"\$/\1/") | |
if test $var = "PATH" |
OlderNewer