#Yii2 basic htaccess
a. Automatic setting index.php
This method created .htaccess files automatically and clear self.
var commentSchema = new Schema({ | |
postId: { | |
type: String, | |
hashKey: true | |
}, | |
id: { | |
type: String, | |
rangeKey: true, | |
default: shortId.generate |
[program:horizon] | |
process_name=%(program_name)s_%(process_num)02d | |
command=php /var/www/ub-admin-client/artisan horizon | |
autostart=true | |
autorestart=true | |
user=fixable | |
startsecs = 0 | |
redirect_stderr=true | |
stdout_logfile=/var/www/ub-admin-client/storage/logs/horizon.log | |
stopwaitsecs=3600 |
before_script: | |
- echo 'Before script' | |
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' | |
- eval $(ssh-agent -s) | |
- mkdir -p ~/.ssh | |
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - | |
- chmod 700 ~/.ssh | |
- ssh-keyscan -H 'domain.com' >> ~/.ssh/known_hosts | |
- chmod 644 ~/.ssh/known_hosts | |
building: |
<?php | |
namespace App\Traits; | |
trait FullTextSearch | |
{ | |
/** | |
* Replaces spaces with full text search wildcards | |
* | |
* @param string $term |
#Yii2 basic htaccess
This method created .htaccess files automatically and clear self.
function curl_get($url, $referer = 'https://www.google.com'){ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_HEADER, true); | |
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'); | |
curl_setopt($ch, CURLOPT_REFERER, $referer); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$data = curl_exec($ch); | |
curl_close($ch); | |
return $data; |
//Translates UTC timestamp to local date | |
function newDate($selector){ | |
var $UTCtimestamp = $($selector).data('timestamp'); | |
var $localData = new Date($UTCtimestamp * 1000); | |
var $date = "0" + $localData.getDate(); | |
var $mount = "0" + ($localData.getMonth() + 1); | |
var $year = $localData.getFullYear(); | |
var $hours = $localData.getHours(); |
https://mlocati.github.io/articles/php-windows-imagick.html | |
https://ourcodeworld.com/articles/read/349/how-to-install-and-enable-the-imagick-extension-in-xampp-for-windows |
//check if the first node is an element node | |
function get_firstChild(n) { | |
var y = n.firstChild; | |
while (y.nodeType != 1) { | |
y = y.nextSibling; | |
} | |
return y; | |
} |