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 / 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) #
# ##############################################################################
@m4tlch
m4tlch / gist:d8200d40178b69eeffe31ee7b532e94d
Created October 22, 2018 11:31
ls in number notification
ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) \
*2^(8-i));if(k)printf("%0o ",k);print}'
@m4tlch
m4tlch / gist:7730f1fe74118836d5e1e3956afa1ddd
Created October 15, 2018 13:42
git detached head fix
git checkout -b temp
git checkout -B master temp
@m4tlch
m4tlch / mails.php
Created September 3, 2018 11:52 — forked from WengerK/mails.php
Drupal 8 - Send mail with Swiftmailer
<?php
use Drupal\Core\Render\Markup;
/**
* Mail hook
*/
function hook_mail($key, &$message, $params) {
$options['langcode'] = $message['langcode'];
@m4tlch
m4tlch / deploy.php
Created August 27, 2018 08:25 — forked from nickdenardis/deploy.php
Zero downtime local build Laravel 5 deploys with Deployer
<?php
namespace Deployer;
require 'recipe/laravel.php';
require 'vendor/deployer/recipes/local.php';
require 'vendor/deployer/recipes/rsync.php';
require 'vendor/deployer/recipes/npm.php';
// Configuration
set('ssh_type', 'native');
@m4tlch
m4tlch / git-aliases
Last active August 24, 2018 13:16 — forked from lukalopusina/git-aliases
GIT Aliases
# GIT
# --------------------------------------------
alias ga="git add"
alias gaa="git add ."
alias gc="git commit -m "
alias gp="git push github"
alias gs="git status"
alias nah="git reset --hard; git clean -df;"
# --------------------------------------------
@m4tlch
m4tlch / gist:a5cd8f26e37fd470411493727adf1103
Created July 30, 2018 07:48 — forked from sabarasaba/gist:3080590
Remove directory from remote repository after adding them to .gitignore
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@m4tlch
m4tlch / Laravel on VestaCP.md
Created July 29, 2018 20:53 — forked from peterbrinck/Laravel on VestaCP.md
Laravel web templates for VestaCP

I've made a new web template to make Laravel work easily on VestaCP, and so I wouldn't have to change my Laravel installation, if I ever wanted to deploy it elsewhere.

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 Laravel and just upload your whole project into public_html

@m4tlch
m4tlch / README.md
Created July 10, 2018 10:43 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet