Skip to content

Instantly share code, notes, and snippets.

@nextgenthemes
nextgenthemes / fn-php80-str-polyfills.php
Last active February 21, 2024 10:58
Proper minimalistic str_contains, str_starts_with and str_ends_with polyfills with WordPress coding standards
<?php
/**
* These are based on symfony/polyfill-php80. The aim of this is to have a minimalistic polyfill
* for only the str_* functions of PHP 8.0. Requires php 7.1 or higher.
*
* @link https://github.com/symfony/polyfill-php80/blob/1.x/bootstrap.php
* @link https://github.com/symfony/polyfill-php80/blob/1.x/Php80.php
*
* @license GPL-3.0
* @copyright (c) Fabien Potencier <fabien@symfony.com>, (c) 2024 Nicolas Jonas nextgenthemes.com
@matthewpizza
matthewpizza / install-composer.sh
Created February 13, 2014 03:55
Install Composer on Webfaction
cd $HOME
ln -s `which php54` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php54
echo -e "\n# Composer\nalias composer=\"php54 \$HOME/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile