Skip to content

Instantly share code, notes, and snippets.

View greeflas's full-sized avatar
🇺🇦

Volodymyr Kupriienko greeflas

🇺🇦
View GitHub Profile

Cron

Cron - программа-демон, предназначенная для выполнения заданий в определенное время, или через определенные промежутки времени.Название cron образовано от греческого слова χρόνος (хрόнос) — время (по-английски — cronos). Разработчик cron, Кен Томпсон (англ. Ken Thompson). Для редактирования заданий используется утилита crontab.

Содержание документа

@Seldaek
Seldaek / ext-requires.txt
Last active February 15, 2020 18:52
PHP Extension Requirements on Packagist.org
Taken from packagist.org
Packages with a master branch update since June 1st 2018: 98977
Of those, package having requires on PHP extensions: 11676 (11.79%)
As only ~12% of packages declare their extension requirements,
and even then it might not be a complete list, take all this with
a big grain of salt, it is informative but definitely not a
complete picture of the most used extensions.
<?php
namespace AppBundle\Doctrine;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver\PDOPgSql\Driver as PDOPgSqlDriver;
use Doctrine\ORM\NativeQuery;
class PgSqlNativeQueryCursor
{
@greeflas
greeflas / break_singleton.php
Last active August 23, 2019 10:13
How to break singleton pattern in PHP - https://habr.com/ru/post/450554/
<?php
final class Singleton
{
private static $instance;
public static function getInstance()
{
if (null === self::$instance) {
self::$instance = new self();

Установка приватного пакета с помощью composer

  1. Необходимо создать ssh ключ и добавить его в настройки профиля GitHub, которому пренадлежит нужный репозиторий, если это не было сделано ранее.

Tip: вы можете использовать данный скрипт для создания и добавления SSH ключа.

  1. Указать url приватного репозитория в composer.json следующим образом:
"repositories": [
@greeflas
greeflas / install-toolbox.sh
Last active March 29, 2024 07:53
JetBrains Toolbox installation script for Ubuntu - https://www.jetbrains.com/toolbox/app/
#!/bin/bash
set -e
if [ -d ~/.local/share/JetBrains/Toolbox ]; then
echo "JetBrains Toolbox is already installed!"
exit 0
fi
echo "Start installation..."
<?php
class Item
{
private $cost = 100;
public function getTotal($discount = 7) {
return $this->cost *(100+$discount)/100;
}
}
@franz-josef-kaiser
franz-josef-kaiser / nano-shorts.md
Last active April 8, 2024 09:27
nano keyboard shortcuts

^ = Ctrl key M = Alt key

^G      (F1)            Display this help text
^X      (F2)            Close the current file buffer / Exit from nano
^O      (F3)            Write the current file to disk
^J      (F4)            Justify the current paragraph

^R      (F5)            Insert another file into the current one