Skip to content

Instantly share code, notes, and snippets.

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

Faiyaz Alam faiyazalam

💭
Coding...
View GitHub Profile
@faiyazalam
faiyazalam / How-to-run-composer-with-a-specifig-PHP-version-on-cPanel.txt
Created January 26, 2020 08:15
How to run composer with a specifig PHP version on cPanel?
syntax:
COMPOSER_MEMORY_LIMIT=-1 php-path composer-path update
example:
1) COMPOSER_MEMORY_LIMIT=-1 ea-php72 /opt/cpanel/composer/bin/composer update
2) COMPOSER_MEMORY_LIMIT=-1 /opt/cpanel/ea-php72/root/usr/bin/php /opt/cpanel/composer/bin/composer update
@faiyazalam
faiyazalam / custom-woocommerce-status.php
Created September 21, 2017 17:51
This is a custom plugin for woocommerce. This will add some custom bulk action in order listing.
<?php
/**
* @package Faiyaz_Custom_WC_Status
* @version 1.6
*/
/*
Plugin Name: Custom WooCommerce Status
Description: This is a custom plugin for woocommerce. This will add some custom bulk action in order listing.
Author: Faiyaz Alam
Version: 1.0
@faiyazalam
faiyazalam / instagram.php
Created January 3, 2017 17:46
Get recent images from Instagram using PHP & cURL
<?php
/**
* Supply a user id and an access token
* Jelled explains how to obtain a user id and access token in the link provided
* @link http://jelled.com/instagram/access-token
*/
$userid = "";
$accessToken = "";
// Get our data
function fetchData($url){
@faiyazalam
faiyazalam / raw-sql-query-pimcore-db
Created May 21, 2018 13:58
Raw sql query using Pimcore\Db class in PIMCORE 5
use Pimcore\Db;
$sql = "SELECT * from table_name where`id` = ?";
$stmt = Db::get()->prepare($sql);
$stmt->bindParam(1, 101, \PDO::PARAM_INT);
$stmt->execute();
$result = $stmt->fetchAll();
@faiyazalam
faiyazalam / pimcore-migration-command.txt
Last active October 5, 2021 17:06
Pimcore Migration Command
bin/console pimcore:migrations:migrate -s pimcore_core -n
Run this command after composer update.
@faiyazalam
faiyazalam / pimcore10-docker-compose.yml
Created August 31, 2022 05:43
Pimcore 10.x Docker compose file
services:
redis:
image: redis:alpine
command: [ redis-server, --maxmemory 128mb, --maxmemory-policy volatile-lru, --save "" ]
db:
image: mariadb:10.7
working_dir: /application
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --innodb-file-per-table=1]
volumes:
@faiyazalam
faiyazalam / wp-list-table-custom.php
Created April 3, 2018 12:58
WP_List_Table - Custom
<?php
/*
Plugin Name: WordPress - WP_List_Table - Custom
*/
add_action( 'admin_menu','register_my_custom_menu_page');
function register_my_custom_menu_page(){
global $new_menu_page;
// creating admin menu
@faiyazalam
faiyazalam / access environment variable in web encore - pimcore symfony.txt
Created January 27, 2023 14:50
access environment variable in web encore - pimcore symfony
//inside webpack config file
var Encore = require('@symfony/webpack-encore');
var dotenv = require('dotenv');
Encore
// ...
// define the environment variables
.configureDefinePlugin(options => {
const env = dotenv.config();
@faiyazalam
faiyazalam / script.sh
Last active March 25, 2023 03:07
script to install zeromq php extension - Tested with Pimcore 10 and Official Docker Compose
apt-get update
apt-get install -y build-essential libtool autoconf uuid-dev pkg-config libsodium-dev libzmq3-dev
git clone https://github.com/zeromq/php-zmq.git
cd php-zmq
phpize && ./configure
make && make install
docker-php-ext-enable zmq
#now restart php-fpm container
#container info:
#No LSB modules are available.
@faiyazalam
faiyazalam / Dockerfile
Last active March 25, 2023 03:39
Sample docker file to create pimcore 10 instance with php ZMQ extension
FROM pimcore/pimcore:PHP8.1-fpm
RUN apt-get update
RUN apt-get install -y build-essential libtool autoconf uuid-dev pkg-config libsodium-dev libzmq3-dev
RUN git clone https://github.com/zeromq/php-zmq.git
RUN cd php-zmq && phpize && ./configure
RUN cd php-zmq && make && make install
RUN docker-php-ext-enable zmq
RUN cd /var/www/html/ && rm -rf php-zmq/