Skip to content

Instantly share code, notes, and snippets.

View ToshY's full-sized avatar
🤔
I don't know everything. I just know what I know.

ToshY

🤔
I don't know everything. I just know what I know.
View GitHub Profile
@ToshY
ToshY / docker-run-composer-lts.md
Last active February 9, 2024 20:39
Docker run with composer lts image

Composer

docker run --rm -it -v $(pwd):/app --entrypoint composer:lts install

PHP

docker run --rm -it -v $(pwd):/app --entrypoint /bin/sh composer:lts -c 'php -v'
@ToshY
ToshY / ffprobe-curl.sh
Created March 26, 2023 19:37
FFprobe URL with cURL and headers
curl --silent --header "X-Token: 5edd80e9-bed1-4efe-9492-5bd4de932d84" https://example.com | ffprobe pipe:0 -loglevel quiet -show_streams -print_format json
@ToshY
ToshY / Dockerfile
Created September 17, 2022 17:58 — forked from rhamedy/Dockerfile
Sample Flask App - Ping Service
FROM python:3.8-slim-buster
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
ENTRYPOINT [ "python" ]
CMD [ "app.py" ]
@ToshY
ToshY / _README.md
Created August 25, 2022 12:51 — forked from mob-sakai/_README.md
Run shell script on gist

Run shell script on gist

Shells that support process substitution such as bash and zsh allow to run shell script on gist as follows.

# With curl:
bash <(curl -sL ${GIST_URL}) args...

# With wget:
@ToshY
ToshY / how-to-squash-commits-in-git.md
Created June 8, 2022 19:57 — forked from patik/how-to-squash-commits-in-git.md
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@ToshY
ToshY / BinToUuid.php
Last active April 16, 2022 19:34
Doctrine Extensions UUID_TO_BIN / BIN_TO_UUID with Symfony 5.x / PHP 8.x
<?php
declare(strict_types=1);
namespace App\Service\Application\Doctrine\DqlFunctions;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\AST\Node;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
@ToshY
ToshY / opcache_max_accelarted_files
Created February 1, 2022 22:05
opcache max accelerated files php
find . -type f -print | grep php | wc -l
@ToshY
ToshY / docker-compose.ngrok.yml
Created January 18, 2022 19:14
docker compose shkoliar/ngrok example
version: '3.9'
services:
ngrok-app:
image: shkoliar/ngrok
container_name: ngrok-app
ports:
- 4040:4040
environment:
AUTH_TOKEN: "<ngrok-auth-key>"
@ToshY
ToshY / gpg-non-interactive-key.sh
Created September 23, 2021 20:26
GPG key non-interactive one-liner with variable substitution
printf "Key-Type: 1\nKey-Length: 2048\nSubkey-Type: 1\nSubkey-Length: 2048\nName-Real: %s\nName-Email: %s\nExpire-Date: 0\nPassphrase: %s" $USER_GPG $EMAIL_GPG $PASSPHRASE_GPG | gpg --batch --gen-key
@ToshY
ToshY / docker-compose.yml
Last active July 20, 2021 18:33
Wireguard docker-compose config example
version: '3.7'
services:
wireguard:
image: ghcr.io/linuxserver/wireguard
container_name: wireguard
cap_add:
- NET_ADMIN
- SYS_MODULE
environment: