Skip to content

Instantly share code, notes, and snippets.

View ab-budaev's full-sized avatar
👍
Changing the world

Aleksei Budaev ab-budaev

👍
Changing the world
View GitHub Profile
@ab-budaev
ab-budaev / pdo.php
Created September 12, 2021 11:21
Simple gift to share it in the presentation about PDO and DB patterns
<?php
$connection = new PDO("mysql:host=$host;dbname=$dbname", $user, $password);
$statement = $connection->prepare("INSERT INTO table (col1, col2, col3) VALUES (?, ?, ?)");
$statement->bindParam(1, "value1");
$statement->bindParam(2, "value2");
$statement->bindParam(3, "value3");
@ab-budaev
ab-budaev / remove-git-branches.sh
Created May 27, 2019 13:28
Small bash console command to remove old git branches
git branch --merged >/tmp/merged-branches && vi /tmp/merged-branches && xargs git branch -d </tmp/merged-branches
@ab-budaev
ab-budaev / sync_command.php
Created November 22, 2018 20:32
Sync study groups console command
<?php
namespace App\Console\Commands;
use App\Models\Course;
use App\Models\StudyGroup;
use App\Models\Teacher;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
@ab-budaev
ab-budaev / repo.txt
Last active August 28, 2018 11:35
How to add PHP repository to Debian Jessie
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
sudo su -c "echo 'deb https://packages.sury.org/php/ $(lsb_release -sc) main' > /etc/apt/sources.list.d/php.list"
@ab-budaev
ab-budaev / deploy.php
Created June 1, 2017 10:01
Deployer config for laravel project
<?php
namespace Deployer;
require 'recipe/laravel.php';
// Configuration
set('ssh_type', 'native');
set('ssh_multiplexing', true);
set('git_tty', true); // [Optional] Allocate tty for git on first deployment