Skip to content

Instantly share code, notes, and snippets.

View 0test's full-sized avatar

Andrey 0test

View GitHub Profile
@0test
0test / CompressImages.php
Created September 2, 2022 21:48 — forked from AgelxNash/CompressImages.php
Комманда под artisan для сжатия картинок при помощи https://github.com/maksatweb/compressor.io-php
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use serhatozles\compressio\CompressorIO;
@0test
0test / CommerceGetDiscounts
Created July 8, 2022 10:38
CommerceGetDiscounts
[!CommerceGetDiscounts?
&id=`[*id*]`
&action=`item`
&itemTpl=`@CODE: [+originalPrice+] <div class="disc item_disc">Скидка "[+name+]" [+discount_summ+] руб</div>`
!]
[!CommerceGetDiscounts?
&id=`[*id*]`
&action=`groups`
&itemTpl=`@CODE: [+originalPrice+] <div class="disc grp_disc">Скидка "[+name+]" [+discount+]%</div>`
!]
prepare($data, $modx, $_DocLister, $_extDocLister){
return $data;
}
<?php
namespace EvolutionCMS\Main\Controllers;
use Illuminate\Support\Facades\Cache;
class BaseController{
public $data = [];
public function __construct()
{
$this->evo = EvolutionCMS();
ksort($_GET);
<?php
/**
* replace system settings
* $modx->getConfig('site_name');
*/
return [
'site_name' => 'dev',
'ControllerNamespace' => 'EvolutionCMS\\Main\\Controllers\\',
'which_editor' => 'TinyMCE5',
'filemanager_path' => env('MODX_BASE_PATH'),
# assets
/assets/.thumbs/*
!/assets/.thumbs/index.html
!/assets/.thumbs/.htaccess
/assets/backup/*
!/assets/backup/index.html
!/assets/backup/.htaccess
/assets/cache/*
class PostsController extends BaseController{
public function render()
{
$this->data['posts'] = $this->getPosts();
}
public function getPosts()
{
$result = SiteContent::
where('parent',641)
->withTVs(['post_image','post_anytext'])
DB_TYPE=mysql
DB_HOST=localhost
DB_USERNAME=user
DB_PASSWORD=password
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci
DB_METHOD="SET NAMES"
DB_DATABASE=dbname
DB_PREFIX=evo_
DB_SOCKET=
ssh-keygen -t rsa -b 4096 -C "[email protected]" с твоей почтой для гита
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
cat ~/.ssh/id_rsa >> ~/.ssh/authorized_keys
ssh -T [email protected] тестим коннект
На бегете ещё можно
GIT_SSH_COMMAND="ssh -i ~/.ssh/company" git clone
@0test
0test / GIT
Last active February 15, 2022 15:30
1. Чек ключей
ls -al ~/.ssh
Если есть, нахуй всё и п. 3
2. Генерировать ключ
ssh-keygen -t rsa -b 4096 -C "[email protected]" с твоей почтой для гита
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
cat ~/.ssh/id_rsa >> ~/.ssh/authorized_keys