# prune branches deleted in origin
git remote prune origin
# prune tags
# http://stackoverflow.com/questions/1841341/remove-local-tags-that-are-no-longer-on-the-remote-repository
git fetch --prune <remote> '+refs/tags/*:refs/tags/*'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"devDependencies": { | |
"@babel/cli": "^7.22.9", | |
"@babel/core": "^7.22.9", | |
"@babel/preset-env": "^7.22.9", | |
"@babel/preset-react": "^7.22.5", | |
"babel-loader": "^9.1.2", | |
"clean-webpack-plugin": "^4.0.0", | |
"copy-webpack-plugin": "^11.0.0", | |
"cross-env": "^7.0.3", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OS updates and upgrades, PHP + Apache2 in FCGI | |
sudo apt update && sudo apt upgrade | |
sudo apt install -y php7.2-cli php7.2-fpm php7.2-mbstring php7.2-opcache php7.2-curl php7.2-mysql php7.2-bz2 php7.2-soap php7.2-xml php7.2-gd php7.2-intl php-imagick php-redis php7.2-pgsql php7.2-sqlite3 php7.2-readline php7.2-json php7.2-zip apache2 wget curl git zip unzip | |
sudo a2enmod proxy_fcgi setenvif rewrite | |
sudo a2enconf php7.2-fpm | |
sudo systemctl reload apache2 | |
# Composer | |
wget https://raw.githubusercontent.com/composer/getcomposer.org/5eb0614d3fa7130b363698d3dca52c619b463615/web/installer -O - -q | php -- --quiet | |
chmod +x composer.phar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Insert a value or key/value pair after a specific key in an array. If key doesn't exist, value is appended | |
* to the end of the array. | |
* | |
* @param array $array | |
* @param string $key | |
* @param array $new | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__ . '/vendor/autoload.php'; | |
$s3 = Aws\S3\S3Client::factory($config); | |
$s3->registerStreamWrapper(); | |
$url = 's3://{$bucket}/{$key}'; | |
// Read CSV with fopen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Creating tables in Single site installations | |
function on_activate() { | |
create_table(); | |
} | |
function create_table() { | |
global $wpdb; | |
$table_name = $wpdb->prefix . 'table_name'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace My\Bundle\EventListener; | |
use My\Bundle\User\User; | |
use Symfony\Component\Routing\Router; | |
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; | |
class InteractiveLoginListener | |
{ |