This file contains hidden or 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
// jQuery Simple minutes countdown timer | |
// https://gist.github.com/beshur/7872704 | |
// @beshur | |
$.fn.countdownize = function() { | |
if (typeof window.page_var == "undefined") window.page_var = {}; | |
this.each(function(i) { | |
var obj = $(this); | |
// assumes integer seconds are here |
This file contains hidden or 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
// simple jQuery input[type='number'] imitator | |
// with callback on number change | |
// | |
// supposed markup: | |
// <div class="elemnt"> | |
// <input type="text" class="target" /> | |
// <span class="arr more"></span> | |
// <span class="arr less"></span> | |
// </div> | |
$.fn.inputNumberize = function(options) { |
This file contains hidden or 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
Handlebars.registerHelper("_i18n", function (string, content) { | |
if (!string) return; | |
var t = __(string, {message: content}); | |
return t; | |
}); |
This file contains hidden or 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
// fix jqueryui resizable bug: | |
// | |
// jqueryui resizable on 'resize' event invokes | |
// window.resize event, which maybe unwanted behaviour sometimes | |
// | |
window.onresize = function(event) { | |
if (typeof event.target.getAttribute === 'function') | |
return; | |
}; |
This file contains hidden or 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 Profile extends CActiveRecord | |
{ | |
public function attributeLabels() | |
{ | |
return array( | |
'id' => Yii::t('model', 118), | |
'from' => Yii::t('model', 119), | |
'email' => Yii::t('model', 120), | |
'user_id' => Yii::t('model', 121), |
This file contains hidden or 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::error(function(Exception $exception, $code) | |
{ | |
Log::error($exception); | |
// Save data to the database | |
$getUser = ''; | |
// .... |
This file contains hidden or 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
# Virtual Hosts | |
# | |
<VirtualHost *:80> | |
DocumentRoot "c:\wamp\www\family-beetroot" | |
ServerName family_br.loc | |
</VirtualHost> |
This file contains hidden or 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
.e_checkbox, | |
.e_radiobox { | |
position: relative; | |
display: inline-block; | |
width: 17px; | |
height: 17px; | |
margin-right: 5px; | |
} |
This file contains hidden or 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 | |
/** | |
* Define type of server | |
* | |
* Depending on the type other stuff can be configured | |
* Note: Define them all, don't skip one if other is already defined | |
*/ | |
define( 'DB_CREDENTIALS_PATH', dirname( ABSPATH ) ); // cache it for multiple use |
This file contains hidden or 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
app.post('/login', function(req, res) { | |
console.log(res); | |
passport.authenticate('local', function(err, user, params) { | |
if (req.xhr) { | |
//thanks @jkevinburton | |
if (err) { return res.json({ error: err.message }); } | |
// e.g. in auth.js: | |
// if (!user.emailVerified) { return done(null, false, { message: 'Email is not verified. Please check your email for the link.' }); } | |
if (!user && params) { return res.json({error : params.error}); } |