Skip to content

Instantly share code, notes, and snippets.

View atlance's full-sized avatar

Anton Stepanov atlance

  • Saint Petersburg
View GitHub Profile
<?php
declare(strict_types=1);
namespace App\DomainModel\Project\UseCase\Edit\Add\Team;
use App\Bus\Project\UseCase\Edit\Add\Editor\Command as EditorMessage;
use App\Bus\Project\UseCase\Edit\Add\Observer\Command as ObserverMessage;
use App\DomainModel\AuthAssignment\Entity\AuthAssignment;
use App\DomainModel\AuthAssignment\Entity\AuthAssignmentRepository;
@atlance
atlance / connect_bluetooth_headphones.sh
Created October 1, 2021 23:25 — forked from egelev/connect_bluetooth_headphones.sh
Connect bluetooth headphones on Ubuntu 18.04
#!/usr/bin/env bash
function get_headphones_index() {
echo $(pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}')
}
function get_headphones_mac_address() {
local temp=$(pacmd list-cards | grep bluez_card -C20 | grep 'device.string' | cut -d' ' -f 3)
temp="${temp%\"}"
temp="${temp#\"}"
@atlance
atlance / gist:7af0356d5bd4926797307cd83d16ece6
Created December 25, 2021 01:16 — forked from Neolot/gist:3964380
PHP Склонение числительных
<?php
/**
* Функция склонения числительных в русском языке
*
* @param int $number Число которое нужно просклонять
* @param array $titles Массив слов для склонения
* @return string
**/
$titles = array('Сидит %d котик', 'Сидят %d котика', 'Сидит %d котиков');
function declOfNum($number, $titles)
@atlance
atlance / archive-and-restore-from-github.md
Created May 4, 2022 07:57
Archive/Restore Git Repos to/from GitHub

Archive a GitHub Repository

git clone --bare git@github.com:jonlong/<repo>.git
tar -czf <repo>.git.tar.gz <repo>.git

Deploy an Archived Repository to GitHub

Create a new private repository on the target account:

curl -F 'login=' -F 'token=' -F 'name=jonlong/' -F 'public=0' http://github.com/api/v2/json/repos/create

@atlance
atlance / Controller.php
Last active February 19, 2024 13:43
attributes for nelmio api doc
<?php
declare(strict_types=1);
// ...
use OpenApi\Attributes as OA;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
#[OA\Get(
tags: ['foo-bar'],
@atlance
atlance / GNU-Make.md
Created July 28, 2022 11:42 — forked from rueycheng/GNU-Make.md
GNU Make cheatsheet
@atlance
atlance / git: gitignore.md
Created August 24, 2022 09:11 — forked from jstnlvns/git: gitignore.md
a gitignore cheatsheet

Git sees every file in your working copy as one of three things:

  1. tracked - a file which has been previously staged or committed;
  2. untracked - a file which has not been staged or committed; or
  3. ignored - a file which Git has been explicitly told to ignore.

Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be committed. Some common examples are:

  • dependency caches, such as the contents of /node_modules or /packages
  • compiled code, such as .o, .pyc, and .class files
@atlance
atlance / github_gpg_key.md
Created February 24, 2023 14:29 — forked from ankurk91/github_gpg_key.md
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@atlance
atlance / ykb-test-cards.txt
Created May 26, 2023 11:45
Yapıkredi Posnet test kredi kartları
Kart Numarası CVV SKT
4506 3470 4958 3145 000 24/05
4506 3470 2791 1094 000 24/12
5400 6170 2447 9160 000 24/11
4506 3441 3133 9098 000 21/02
@atlance
atlance / composer-private-package-github-token.md
Created November 25, 2023 12:03 — forked from 1242035/composer-private-package-github-token.md
Generate a GitHub Personal Access Token for Private Composer Packages

Generate a GitHub Personal Access Token for Private Composer Packages

If you're trying to load a private repository with Composer/Laravel, we'll need to generate a GitHub Personal Access Token (similar to OAuth token) to access the repository during a composer install without entering credentials.

If you have used other Github packages from {my-org} before, you may be able to skip this step.

  1. Visit https://github.com/settings/tokens.

  2. Click Generate new token.