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
STEP 1 | |
cat > openssl.cnf <<-EOF | |
[req] | |
distinguished_name = req_distinguished_name | |
x509_extensions = v3_req | |
prompt = no | |
[req_distinguished_name] | |
CN = *.ua.l | |
[v3_req] | |
keyUsage = keyEncipherment, dataEncipherment |
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 authInterceptor($rootScope, localStorageService, $q, $timeout, $location, APP_CONFIG) { | |
return { | |
response : function(response) { | |
if(response) { | |
var freshJwt = response.headers().authorization; | |
if (freshJwt) { | |
//refresh local token | |
localStorageService.set(APP_CONFIG.jwt_key, freshJwt); |
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 | |
class ServicePackageRepository | |
{ | |
/** | |
* @return int | |
*/ | |
public function getTrialDaysCount() | |
{ | |
$cDate = Carbon::parse(self::TRIAL_DUE_FOR_STANDARD_PLAN); |
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 | |
/** | |
* Find Landing pages where has fields with date value by month | |
* Date format is mm/dd/yyyy | |
*/ | |
$eventItemsIds = LandingPage::where('section', 'events_items')->whereHas('fields', function ($query) use($month,$year) { | |
$query->whereHas('texts', function($query) use($month,$year) { | |
$query->where(\DB::raw('MONTH(STR_TO_DATE(value, \'%m/%d/%Y\'))'), '=', $month) | |
->where(\DB::raw('YEAR(STR_TO_DATE(value, \'%m/%d/%Y\'))'), '=', $year); | |
}); |
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 | |
$q = 'someFirstNameOrLastNameOrCompany'; | |
$limit = 20; | |
$threads = Thread::latest('updated_at') | |
->whereHas('participants', function($query) use($q) { | |
$query->whereHas('user', function($query) use($q) { | |
//search connected two tables if any of them has record appropriate to $q | |
$query->where(function($subQuery) use($q) { |
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 | |
abstract class Controller_Common extends Controller | |
{ | |
use Traits_ItemSeo; | |
public function after() | |
{ | |
$view->title = $this->getMetaTitle(); | |
$view->description = $this->getMetaDescription(); | |
$view->socialTitle = $this->getSocialTitle() ?: $this->getMetaTitle(); |
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 | |
/** | |
* Persist quotes. For Facebook share etc. | |
* @param string $value | |
* | |
* @return mixed | |
*/ | |
public static function convertQuotes($value) | |
{ | |
return str_replace('"', '\'', htmlspecialchars_decode($value, ENT_QUOTES)); |
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
myImage.addEventListener('onload', function() { | |
console.log('My width is: ', this.naturalWidth); | |
console.log('My height is: ', this.naturalHeight); | |
}); |
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 file_newname($path, $filename){ | |
if ($pos = strrpos($filename, '.')) { | |
$name = substr($filename, 0, $pos); | |
$ext = substr($filename, $pos); | |
} else { | |
$name = $filename; | |
} | |
$newpath = $path.'/'.$filename; |
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
<?=Html::anchor( | |
'http://maps.google.com/maps?q=' . urlencode(View::$global->settings['address']) . '&z=16&output=embed', | |
'<img src="http://maps.google.com/maps/api/staticmap?center=' . urlencode(View::$global->settings['address']) . '&zoom=15&size=390x225&sensor=false&markers=color:red%7C' . urlencode(View::$global->settings['address']) . '" alt="">', | |
array('class' => 'contact-map', 'onclick' => 'system.showMap(this);return false;') | |
)?> |
NewerOlder