All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Register

Login


All New Register Login
's Avatar

anthony

Joined 1739410376

Recently created
Least recently created
Recently updated
Least recently updated
All gists 39
anthony's Avatar

anthony / CUE-sheet generator for youtube-dl

0 likes
0 forks
1 files
Last active 1740033278
shell
1 #!/bin/bash
2 # CUE-sheet generator for youtube-dl
3
4 # Usage:
5 # 0. Install 'jq' utility
6 # 1. Download any audio file with metadata from YouTube or Youtube Music, e.g.
7 # $ youtube-dl \
8 # --extract-audio \
9 # --audio-format flac \
10 # --audio-quality 0 \
anthony's Avatar

anthony / Git configs

0 likes
0 forks
2 files
Last active 1740109988
My favourite global .gitconfig with aliases (ru comments)
dotfiles git
1 [user]
2 # ...
3 # signingkey = <key>
4 # git config user.signingkey ... -- установить ключ
5 [commit]
6 gpgSign = true
7 [tag]
8 gpgSign = true
9 [push]
10 default = current
anthony's Avatar

anthony / Get caller class, function and line number

0 likes
0 forks
1 files
Last active 1740033025
php
1 <?php
2
3 /**
4 * Returns caller class/file name, function and line where current
5 *
6 * Potentially doesn't cover all cases, but is simple and pretty handy for use in frameworks.
7 *
8 * @param bool $as_array result as array or string in this format: `<file|class>:<func>():<line>`
9 * @return string|array
10 */
anthony's Avatar

anthony / Interpreter helper to debug dockerized cli php scripts in NetBeans

0 likes
0 forks
1 files
Last active 1740032957
ide netbeans php
1 #!/bin/bash
2
3 # Welcome to amusement park!
4
5 [[ "$1" = '--help' ]] || [[ "$1" = '-h' ]] && cat <<EOF && exit
6 NetBeans docker wrapper for php
7 ===============================
8 Anthony Axenov (c) 2023, The MIT License
9 https://axenov.dev
10 https://opensource.org/license/mit
anthony's Avatar

anthony / Simple and universal file logger

0 likes
0 forks
1 files
Last active 1740032833
php
1 <?php
2 function output(...$data)
3 {
4 $result = [];
5 foreach ($data as $something) {
6 if ($something instanceof Illuminate\Support\Collection) {
7 $something = $something->toArray();
8 }
9 if (is_array($something)) {
10 $something = var_export($something, true);
anthony's Avatar

anthony / Useful phpunit asserts

0 likes
0 forks
1 files
Last active 1740032735
php
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Tests;
6
7 use Illuminate\Support\Collection;
8 use PHPUnit\Framework\TestCase;
9
10 class BasicTestCase extends TestCase
anthony's Avatar

anthony / Set custom display resolution using xrandr

0 likes
0 forks
1 files
Last active 1740032542
shell xrandr
1 #!/bin/bash
2 #########################################################################
3 # #
4 # Set display resolution #
5 # #
6 # Author: Anthony Axenov (Антон Аксенов) #
7 # Version: 1.0 #
8 # License: WTFPL #
9 # #
10 #########################################################################
anthony's Avatar

anthony / Real-time PHP-FPM Status

0 likes
0 forks
1 files
Last active 1740032355
Taken from https://gist.github.com/shakahl/9dab7d1e49c5d8d6a57a4633a702d23c
php

Real-time PHP-FPM Status

This gist will explain you how to enable an undocumented feature of PHP-FPM which will give a real-time performance stats.

Everybody knows the famous phpinfo() and the page it generates, right? Then the real-time PHP-FPM status page design is very similar.

image

Some informations from the top are not displayed to avoid security issues.

Enable PHP-FPM Status

anthony's Avatar

anthony / Get latest release from GitHub

0 likes
0 forks
1 files
Last active 1740032296
Taken from https://gist.github.com/shakahl/d629dbe9d41f57699dba597929582c9f
curl github shell
1 #!/bin/bash
2 get_latest_release() {
3 curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
4 grep '"tag_name":' | # Get tag line
5 sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
6 }
anthony's Avatar

anthony / Simple dotenv loader

0 likes
0 forks
1 files
Last active 1740032215
Taken from https://gist.github.com/shakahl/9933eb74b8a89d3e5f34c86ce1f0c840
env php
1 <?php
2
3 /**
4 * Loads an environment variable
5 *
6 * @param string $name
7 * @param mixed|null $def
8 * @param bool $local
9 * @return array|mixed|string|null
10 */
Newer Older

Powered by Opengist ⋅ Load: 197ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文