Skip to content

Instantly share code, notes, and snippets.

View LivesInSpb's full-sized avatar

Artem LivesInSpb

View GitHub Profile
I don't care - Мне всё равно
pros and cons - за и против
It's up to you - Решай сам
What of it? - И что из этого?
It's out of place - Это неуместно
What for? - Зачем?
It's waste of time - Это трата времени
Let's clear it up - Давай разберёмся.
Let's drop the subject - Давай оставим эту тему
Mind one's own business - Занимайся своим делом
@LivesInSpb
LivesInSpb / text
Last active September 12, 2018 09:17
Laravel -> AppServiceProvider -> boot()
Laravel have more interesting providers. For what?
For example.
For all pages we have one block which get to us archives (months & year).
Ok.
We have Post model and method archives() which return list "Month Year"
Febriary 2018
January 2018
March 2017
etc.
@LivesInSpb
LivesInSpb / scp.sh
Created June 4, 2018 15:00
scp copying (from to) ssh servers
To server
File
scp /home/file1.zip root@192.168.0.2:/home2/
Folder
scp -r /home/ root@192.168.0.2:/home2/
From server
File
scp root@192.168.0.2:/home2/file1.zip /home/
Folder
@LivesInSpb
LivesInSpb / file.txt
Last active May 29, 2018 08:06
Github library php
A fast string manipulation library with multibyte support. Based on "Stringy" lib, with focus on speed.
https://github.com/fe3dback/str
Improvements to PHP's type system in userland: generics, typed lists, tuples and structs https://spatie.be/en/opensource/php
https://github.com/spatie/typed
Dialogue and the Art of Thunking Together
The Web of life
PHP: Objects, Patterns, and Practice (matt zandstra)
Gang of Four
@LivesInSpb
LivesInSpb / script.sh
Last active August 3, 2018 12:27
Mercurial (HG) to GIT
Some time ago I get project.
And before get it, I ask "What CVS you use for?". Answer been "GIT!"
Ok.
But how I been impressed becouse CVS been Mercurial (HG).
Ok, it is what it is.
Google helped me.
https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git
@LivesInSpb
LivesInSpb / links.txt
Last active April 12, 2018 12:19
drupal 8
@LivesInSpb
LivesInSpb / translate_en_to_ru.txt
Last active February 14, 2018 16:01
translate en to ru
accept - принять
apply - применить
deny - отказать
cancel - отменить
delete - удалить
are you sure? - вы уверены?
password - пароль
login - логин
name - имя
last name - фамилия
@LivesInSpb
LivesInSpb / rsa.php
Last active January 26, 2018 10:38
create rsa keys & encode/decode
<?php
$data = 'XCC58-AYA68-75ZUU-19TDZ';
$config = array(
'digest_alg' => 'sha512',
'private_key_bits' => 4096,
'private_key_type' => OPENSSL_KEYTYPE_RSA,
);
@LivesInSpb
LivesInSpb / nginx.conf
Last active January 24, 2018 14:52
nginx.conf
server
{
listen *:80;
server_name .domain;
charset utf8;
root /home/livesinspb/httpdocs/domains/domain;
access_log /home/livesinspb/httpdocs/logs_all/domain.access.log ;
error_log /home/livesinspb/httpdocs/logs_all/domain.error.log debug;