Skip to content

Instantly share code, notes, and snippets.

View m4tlch's full-sized avatar
🏠
Working from home

Paul Nike m4tlch

🏠
Working from home
  • Ukraine
View GitHub Profile
@m4tlch
m4tlch / respond_and_process.php
Created June 13, 2019 16:15 — forked from kfriend/respond_and_process.php
PHP: Send response and continue processing
<?php
// Buffer all upcoming output...
ob_start();
// Send your response.
echo "Testing response";
// Get the size of the output.
$size = ob_get_length();
@m4tlch
m4tlch / checkbox.blade.php
Created March 19, 2019 19:21 — forked from skadimoolam/checkbox.blade.php
Customizable form partials for Laravel - https://laravelcollections.com
@php
$d = $d ?? null; // default value
@endphp
<div class="form-group row">
<label for="{{ $n }}" class="col-sm-4 col-form-label text-md-right"><b>{{ $l }}</b></label>
<div class="col-md-8">
<input id="{{ $n }}" type="checkbox" class="form-control" name="{{ $n }}" value="1" @if(old($n, $d) == '1') checked @endif>
@if ($errors->has($n))
<small class="text-danger">{{ $errors->first($n) }}</small>
php artisan view:cache && php artisan route:cache && php artisan config:cache
@m4tlch
m4tlch / gist:d0109b9eae5eae4b5cb06dd422ba3636
Last active February 22, 2019 14:13
Laravel 5 cache clear
php artisan config:clear
php artisan cache:clear
composer dump-autoload
php artisan view:clear
php artisan route:clear
sudo chmod -Rf 0777 /var/www/html/{project-name}/bootstrap/cache
sudo chmod -Rf 0777 /var/www/html/{project-name}/storage
@m4tlch
m4tlch / jira_letsencrypt.md
Created December 23, 2018 20:52 — forked from dborin/jira_letsencrypt.md
HOWTO Configure Atlassian Jira to use Letsencrypt certificate

HOWTO Configure Atlassian Jira to use Letsencrypt certificate with default Tomcat

This is a primer for installing a Letsencrypt certificate on a Jira server that is running the Jira provided, default Tomcat for serving webpages.

I found lots of information about how to do it using a free-standing Tomcat or nginx, but nothing about this particular combination. I hope it helps you!

Obviously, in all the examples, you need to replace jira.example.com with your own domain! And (duh) you need to use your own password, not 1234

You need to have installed Java (outside the scope of this document). Then in your user's shell RC file and probably root's RC file, add

@m4tlch
m4tlch / Drupal 8 on VestaCP.md
Last active July 26, 2022 05:59
Templates for Drupal 8 on VestaCP

Each file should be put in /usr/local/vesta/data/templates/web/apache2

Then, when you edit your domain/site, you can change the web template to Drupal8 and just upload your whole project into public_html

@m4tlch
m4tlch / disable-scroll.js
Created December 17, 2018 15:40 — forked from grayghostvisuals/disable-scroll.js
Disable hover on scroll to improve performance and avoid costly paints.
// Disable Hover on Scroll Class
// Add these helpers to your utlity.css
// http://www.thecssninja.com/javascript/pointer-events-60fps
.disable-hover,
.disable-hover * {
pointer-events: none !important;
}
// ----------------------------------------------------------------------
@m4tlch
m4tlch / unsorted form amoCRM
Created November 30, 2018 12:13 — forked from LipinArts/unsorted form amoCRM
amoCRM unsorted form
<?php
// ваши данные для авторизации
$api_key = '';
$login = '';
$subdomain = '';
// id полей в вашем аккаунте
$phone_field_id = ;
$phone_type_id = ;
@m4tlch
m4tlch / gist:e31d213dc9b42eeba9d741f5330ed437
Created October 24, 2018 13:28
.htaccess with cross-origin settings for amocrm.ru
<IfModule mod_headers.c>
Header set Content-Security-Policy "frame-ancestors http://*.amocrm.ru/ 'self';"
# For IE 11 and below
Header set X-Frame-Options SAMEORIGIN
Header append X-Frame-Options "ALLOW-FROM http://*.amocrm.ru/"
</IfModule>
# Apache Server Configs v2.0.0 | MIT License
# https://github.com/h5bp/server-configs-apache
# (!) Using `.htaccess` files slows down Apache, therefore, if you have access
# to the main server config file (usually called `httpd.conf`), you should add
# this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html.
# ##############################################################################
# # CROSS-ORIGIN RESOURCE SHARING (CORS) #
# ##############################################################################