Skip to content

Instantly share code, notes, and snippets.

View ppabcd's full-sized avatar
🏠
Working from home

Reza Juliandri ppabcd

🏠
Working from home
View GitHub Profile
@ppabcd
ppabcd / .php-cs-fixer.php
Created October 2, 2023 06:45
Laravel 10 Fixer
<?php
use PhpCsFixer\Config;
use PhpCsFixer\DocBlock\TypeExpression;
use PhpCsFixer\Finder;
use PhpCsFixer\Fixer\FixerInterface;
use PhpCsFixer\FixerDefinition\FixerDefinition;
use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
use PhpCsFixer\Tokenizer\Token;
use PhpCsFixer\Tokenizer\Tokens;
@ppabcd
ppabcd / pre-commit
Last active November 8, 2023 08:29
Laravel 10 pre-commit
#!/bin/sh
FILE="${PWD}/.php-cs-fixer.php"
COMPOSER_PATH="/usr/bin/composer"
COMMAND="lint"
CONFIG_URL="https://gist.githubusercontent.com/ppabcd/0dc95e7130ba46e9edc095ca57f23af6/raw/db5b07ee97ddbd2e2183d86ab996a0fefacc4dea/.php-cs-fixer.php"
# Version and Release Manager
VERSION_FILE="${PWD}/.version"
RELEASE="${PWD}/release"
VERSION="0.1.0"
@ppabcd
ppabcd / laravel10-fixer.sh
Last active October 2, 2023 07:21
Laravel 10 Fixer
#!/bin/sh
wget -O pre-commit "https://gist.githubusercontent.com/ppabcd/176d0276e047f89b16596f9a5fdb4aa2/raw/pre-commit?$(date +%s)"
mv ./pre-commit ./.git/hooks/pre-commit
rm -rf ./.git/hooks/prepare-commit-msg
chmod +x ./.git/hooks/pre-commit
@ppabcd
ppabcd / decorator.ts
Last active December 24, 2023 09:44
Example of decorator @command, @Listener and @callbackQuery for telegram bot with grammY and inversify
/* eslint-disable @typescript-eslint/no-explicit-any */
import {ICommand} from "../core/ICommand"
import {IListener} from "../core/IListener"
import {ICallbackQuery} from "../core/ICallbackQuery"
import {kylaContainer} from "../../../di/inversify.config"
import {Container, injectable as originalInjectable} from "inversify"
import {promises as fs} from "fs"
import path from "path"
// eslint-disable-next-line @typescript-eslint/no-explicit-any