Skip to content

Instantly share code, notes, and snippets.

View faiyazalam's full-sized avatar
💭
Coding...

Faiyaz Alam faiyazalam

💭
Coding...
View GitHub Profile
@sarahcssiqueira
sarahcssiqueira / webpack dependencies
Last active April 19, 2024 18:15
webpack.config.js for WordPress projects
{
"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",
@erickthered
erickthered / Pimcore 5 VM automatic setup
Created April 26, 2019 16:07
Steps to have a pimcore project up and running on a clean VM running Ubuntu 18.04
# 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
@dgoguerra
dgoguerra / git-prune.md
Created September 8, 2016 13:59
Prune branches and tags deleted in the remote
# 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/*'
@wpscholar
wpscholar / array-insert-after.php
Created November 7, 2015 13:04
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.
<?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
*
@jeremeamia
jeremeamia / aws-csv-streamwrapper.php
Created June 6, 2014 18:23
Shows how to read a CSV stored in S3 using the AWS SDK for PHP's S3 Stream Wrapper.
<?php
require __DIR__ . '/vendor/autoload.php';
$s3 = Aws\S3\S3Client::factory($config);
$s3->registerStreamWrapper();
$url = 's3://{$bucket}/{$key}';
// Read CSV with fopen
@sudar
sudar / 1.php
Last active September 10, 2022 17:59
How To Properly Create Tables In WordPress Multisite Plugins. Explanation at http://sudarmuthu.com/blog/how-to-properly-create-tables-in-wordpress-multisite-plugins/
<?php
// Creating tables in Single site installations
function on_activate() {
create_table();
}
function create_table() {
global $wpdb;
$table_name = $wpdb->prefix . 'table_name';
@snc
snc / InteractiveLoginListener.php
Created October 25, 2011 13:44
Custom FOSUB redirects
<?php
namespace My\Bundle\EventListener;
use My\Bundle\User\User;
use Symfony\Component\Routing\Router;
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
class InteractiveLoginListener
{