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 User extends AppModel { | |
public $validate = array( | |
'email' => array( | |
'isUnique' => array( | |
'rule' => 'isUnique', | |
'message' => 'This email is already used.' | |
), | |
'email' => array( | |
'rule' => 'email', |
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 User extends Eloquent { | |
public $rules = array( | |
'email' => 'required|email|unique:users', | |
'password' => 'between:8,50' | |
); | |
public function posts() | |
{ | |
return $this->has_many('Post'); | |
} |
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 User extends CActiveRecord { | |
public static function model($className=__CLASS__) | |
{ | |
return parent::model($className); | |
} | |
public function relations() | |
{ | |
return 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 | |
function maxProfit($A) { | |
$maxProfit = 0; | |
for ($P = 0, $N = count($A); $P < $N; ++$P) { | |
for ($Q = $P; $Q < $N; ++$Q) { | |
if ( | |
$A[$Q] >= $A[$P] && | |
$A[$Q] - $A[$P] > $maxProfit | |
) { |
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
<script>(function(d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) {return;} | |
js = d.createElement(s); js.id = id; | |
js.src = "http://connect.facebook.net/en_US/all.js#xfbml=1"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk'));</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
test |
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 ipc = ipc || {}; | |
// Step 1: Maintain BC with ipc.adtech | |
ipc.adloader = ipc.adtech = function () { | |
/** | |
* DFP acount ID | |
*/ | |
var _dfp_account_id = '', |
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 function disqus when you scroll down to disqus div. | |
| | |
| @author Marcin Wawrzyniak | |
|--------------------------------------------------------------------------------------- | |
*/ | |
(function($){ | |
var loadDisqus = 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
[echo] Regenerating CSS files from scss using Compass | |
/var/lib/jenkins/workspace/ipc-sites-trustedreviews-frontend-sf2/ipc-sites-trustedreviews-frontend-sf2 | |
directory ../src/Ipc/TrBundle/Resources/public/generated-css/ | |
directory ../src/Ipc/TrBundle/Resources/public/generated-css/pages/ | |
error bootstrap.scss (Line 5: File to import not found or unreadable: sass-bootstrap/sass/variables. | |
Load paths: | |
/var/lib/jenkins/workspace/ipc-sites-trustedreviews-frontend-sf2/ipc-sites-trustedreviews-frontend-sf2/src/Ipc/TrBundle/Resources/public/compass | |
/opt/ipc/lib/ruby/gems/1.9.1/gems/compass-0.12.2/frameworks/blueprint/stylesheets | |
/opt/ipc/lib/ruby/gems/1.9.1/gems/compass-0.12.2/frameworks/compass/stylesheets |
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 FastClick(b){var c,a=this;this.trackingClick=false;this.trackingClickStart=0;this.targetElement=null;this.touchStartX=0;this.touchStartY=0;this.lastTouchIdentifier=0;this.touchBoundary=10;this.layer=b;if(!b||!b.nodeType){throw new TypeError("Layer must be a document node");}this.onClick=function(){return FastClick.prototype.onClick.apply(a,arguments);};this.onMouse=function(){return FastClick.prototype.onMouse.apply(a,arguments);};this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(a,arguments);};this.onTouchMove=function(){return FastClick.prototype.onTouchMove.apply(a,arguments);};this.onTouchEnd=function(){return FastClick.prototype.onTouchEnd.apply(a,arguments);};this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(a,arguments);};if(FastClick.notNeeded(b)){return;}if(this.deviceIsAndroid){b.addEventListener("mouseover",this.onMouse,true);b.addEventListener("mousedown",this.onMouse,true);b.addEventListener("mouseup",this.onMouse,true);}b.addEventListe |
OlderNewer