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: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
@m4tlch
m4tlch / get_token.js
Created September 28, 2017 07:39
Auth token from amo
(function(m, id, cb){
$.ajax({
method: "GET",
headers: {"X-Auth-Token": m.auth_token},
url: m.server_base + "/ui/api/v1.1/ajax/mail/attach/" + id,
success: cb
});
})(
// Объект авторизации AmoMail
AMOCRM.constant('amomail'),
@m4tlch
m4tlch / my.cnf
Created March 16, 2017 21:04 — forked from petemcw/my.cnf
Ubuntu MySQL 5.1 Configuration - 4GB RAM, Heavy InnoDB
# The MySQL database server configuration file.
#
# DESC: InnoDB mainly, heavy queries, fewer connections, 4GB RAM
#
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# This was formally known as [safe_mysqld]. Both versions are currently parsed.