Skip to content

Instantly share code, notes, and snippets.

View adamsafr's full-sized avatar
🏠

Adam Sapraliev adamsafr

🏠
View GitHub Profile
@tsvtt
tsvtt / скачать видео с boosty.md
Last active December 26, 2025 08:38
Скачать видео с boosty
  • Открыть страницу с видео, видеоплеер должен быть виден на странице
  • Открыть средства разработчика в браузере (F12), открыть вкладку с консолью
  • Выполнить:
    document.querySelector('vk-video-player').store.actions.internal.downloadVideo()
— Да?
— Алё!
— Да да?
— Ну как там с деньгами?
— А?
— Как с деньгами-то там?
— Чё с деньгами?
— Чё?
— Куда ты звонишь?
@onomatopellan
onomatopellan / wsl.conf
Last active December 19, 2023 09:09
/etc/wsl.conf Avoid adding Windows Path to Linux $PATH
[interop]
appendWindowsPath=false
@carstenwindler
carstenwindler / xdebug.sh
Last active June 20, 2025 18:18
Bash script to quickly enable / disable xdebug in a PHP docker container
#!/usr/bin/env bash
# see https://carstenwindler.de/php/enable-xdebug-on-demand-in-your-local-docker-environment/
if [ "$#" -ne 1 ]; then
SCRIPT_PATH=`basename "$0"`
echo "Usage: $SCRIPT_PATH enable|disable"
exit 1;
fi
# Expects service to be called app in docker-compose.yml
@BoShurik
BoShurik / PostModel.php
Created April 3, 2019 19:26
UniqueModel
namespace App\Post\Model;
use App\Model\Validator\Constraints\UniqueModel;
/**
* @UniqueModel(class="App\Entity\Post", fields={"user": "user", "slug": "slug"})
*/
class PostModel
{
public $user;
@Xymanek
Xymanek / Readme.md
Last active February 17, 2022 13:52
UniqueDto validator

It can

  • properly deal with multi-fields uniqueness checks (and composite PKs)
  • use symfony's property path or directly private properties
  • does not cause hydration when checking
  • allows to optionally map to existing entity (by having it as property) or by mapping id fields (or none at all so any matching record will trigger a failure)
  • allows to re-map fields between DTO and entity (eg. fields={"display_name": "username"}). Combined with sf property accessor this allows for "virtual properties". This also works for id fields
  • load the violating record to show in debug panel. Example http://prntscr.com/i3ifbn
  • not get confused if multiple violating records are found
@ostrolucky
ostrolucky / ColumnHydrator.php
Last active January 3, 2022 11:53
Doctrine ColumnHydrator
<?php
declare(strict_types=1);
namespace App\ORM\Hydration;
use Doctrine\ORM\Internal\Hydration\ArrayHydrator;
/**
* Returns one-dimensional scalar array from query: mixed[][] => mixed[]
@zmts
zmts / tokens.md
Last active December 19, 2025 07:20
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@midascodebreaker
midascodebreaker / laravel-per-project-installation.md
Last active March 15, 2022 10:09
Laravel Homestead per Project Installation on Windows 10
Prerequisite:
  • Php7
  • Composer
  • Gulp
  • Npm
  • Vagrant
  • Virtual Box
  • Laravel Installer
@nepsilon
nepsilon / git-change-commit-messages.md
Last active November 19, 2024 18:18
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.