Skip to content

Instantly share code, notes, and snippets.

View Tegos's full-sized avatar
🐼

Ivan Mykhavko Tegos

🐼
View GitHub Profile
@Tegos
Tegos / mysql-backup.sh
Last active July 15, 2022 07:40
Mysql backup bash script for production
#!/bin/bash
TODAY=`date +%d.%m.%Y`
TODAY_TIME=`date +%d.%m.%Y-%T`
DB_BACKUP_PATH='/backups/mysql-backups'
MYSQL_CONFIG_PATH='/backups/mysql.cnf'
DATABASE_NAME='asg'
DB_FILE=${DB_BACKUP_PATH}/${TODAY}/${DATABASE_NAME}-${TODAY_TIME}.sql
@Tegos
Tegos / getTiles.py
Created May 5, 2021 08:29 — forked from devdattaT/getTiles.py
Downloading of Slippy Tiles using Shapely.
import math
import os
import urllib
from shapely.geometry import Polygon
def deg2num(lat_deg, lon_deg, zoom):
lat_rad = math.radians(lat_deg)
n = 2.0 ** zoom
xtile = int((lon_deg + 180.0) / 360.0 * n)
ytile = int((1.0 - math.log(math.tan(lat_rad) + (1 / math.cos(lat_rad))) / math.pi) / 2.0 * n)
@Tegos
Tegos / Laravel-Container.md
Created August 4, 2020 05:03
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Translations: Korean (by Yongwoo Lee)

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

@Tegos
Tegos / React-Directory-Layout.md
Created August 21, 2017 06:38 — forked from koistya/React-Directory-Layout.md
File and folder naming convention for React.js components

File and folder naming convention for React.js components

Directory Layout #1

/actions/...
/components/common/Link.js
/components/common/...
/components/forms/TextBox.js
/components/forms/TextBox.res/style.css