Skip to content

Instantly share code, notes, and snippets.

View electroidru's full-sized avatar

electroidru

View GitHub Profile
@nickcernis
nickcernis / old-version-homebrew.md
Last active April 4, 2025 07:42
Install an old version with homebrew for macOS
  1. Find the formula for the version you want to install:

    • Visit https://github.com/Homebrew/homebrew-core/tree/master/Formula
    • Click the file with your formula (e.g. “composer.rb”)
    • Click “History” (top right)
    • Click the commit hash for the version you want to download
    • Click the three dots (top right of diff) and choose “view file”
    • Click “Raw” and copy the raw URL from the browser address bar.

    For example, composer 1.10.15 lives here: https://github.com/Homebrew/homebrew-core/blob/9e6e6a1ca8551901bff69d329c7fbb9007064134/Formula/composer.rb

@anoriar
anoriar / AuthorTable.php
Created July 16, 2018 13:46
Сущности многие ко многим: Книги Авторы, сложный запрос: перечисление авторов каждой книги
namespace Orm;
use Bitrix\Main\Entity;
class AuthorTable extends Entity\DataManager{
public static function getTableName()
{
return 'author';
}
@mcguffin
mcguffin / acf-get-field-key.php
Last active June 13, 2023 13:32
WordPress Advanced Custom Fields get field key from field name
<?php
/**
* Get field key for field name.
* Will return first matched acf field key for a give field name.
*
* ACF somehow requires a field key, where a sane developer would prefer a human readable field name.
* http://www.advancedcustomfields.com/resources/update_field/#field_key-vs%20field_name
*
* This function will return the field_key of a certain field.