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
/** | |
* Replace mobile URL of WhatsApp with Desktop | |
* The mobile first strategy is used cause most people decide to not show WhatsApp on Desktop but only on mobile where it is very useful | |
* | |
* @dependencies [ core/w-ismobile.js ] | |
*/ | |
if(withOptions.whatsappWeb && !jQuery.browser.mobile && $(".whatsapp-weburl").length > 0){ | |
clog('WhatsApp Enabled and Present'); | |
clog($(".whatsapp-weburl")); |
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
<!-- AngularJS ng-show and ng-click --> | |
<div class="checkbox"> | |
<label ng-click="show = !show"> | |
<input type="radio" name="cat_id" value="1"> | |
<strong>Residenziale</strong> Immobili in vendita oppure in affitto<br> | |
</label> | |
<span ng-show="show"> | |
<label class="checkbox-inline"> | |
<input type="radio" value="A" name="res_sell_type"> |
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 | |
/* | |
* spesso abbiamo bisogno di parametri default obbligatori | |
* ma che possono essere sovrascritti con quelli custom passati alla funzione ad ogni chiamata | |
* ... la suluzione in 4 righe e' questa | |
* --- | |
* [EN] often we need a mandatory options parameters that can be overriden by custom params passed each time | |
* the solution is here in 4 rows of 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
/* OVERWRITED */ | |
.modal-footer {margin-top:0px;} | |
.center-block { | |
float:none; | |
} | |
/* Tables * / | |
.table-striped > thead > tr { | |
background-color: #D196A4; |
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 at the top of ./config/app.php | |
// Custom Monolog Configuration - https://laravel.com/docs/5.2/errors#configuration | |
use Monolog\Logger; | |
use Monolog\Handler\StreamHandler; | |
use Illuminate\Mail\TransportManager; | |
$app->configureMonologUsing(function($monolog) use ($app) { |
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
ga(function(tracker) { | |
var ga_refferer = tracker.get('referrer'); // this get the referral from google analytics.js | |
if (typeof wCookies != 'undefined' && typeof wCookies().get('ga_refferer') == 'undefined') { | |
if (typeof ga_refferer != 'undefined') { | |
wCookies().set('ga_refferer', ga_refferer, {expires: 30}); | |
} else { | |
wCookies().set('ga_refferer', 'direct', {expires: 30}); | |
} |
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
/** | |
* jQuery.browser.mobile (http://detectmobilebrowser.com/) | |
* | |
* jQuery.browser.mobile will be true if the browser is a mobile device | |
* | |
**/ | |
(function (a) { | |
(jQuery.browser = jQuery.browser || {}).mobile = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi( |
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
Instead of if and isset, directly isset Laravel v5.4 | |
@isset($aVar) | |
// if (isset($aVar)) | |
@else | |
// else | |
@endisset | |
Loops |
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 | |
public function beforeFind($event, $query, $options, $primary) | |
{ | |
// if query builder have ->applyOptions(['default' => false]) not use default conditions and return query | |
if (isset($options['default']) && $options['default'] == false) { | |
return $query; | |
} | |
// default conditions |
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
<!-- 1 --> | |
<a href="#" id="totop">TOP</a> | |
<script> | |
if ($('#totop').length) { | |
var scrollTrigger = 100, // px | |
backToTop = function () { | |
var scrollTop = $(window).scrollTop(); | |
if (scrollTop > scrollTrigger) { | |
$('#totop').addClass('show'); | |
} else { |