Skip to content

Instantly share code, notes, and snippets.

View ediamin's full-sized avatar
:octocat:
Exploring

Edi Amin ediamin

:octocat:
Exploring
View GitHub Profile
@ediamin
ediamin / build_pcntl.sh
Created May 3, 2018 13:06 — forked from jbanety/build_pcntl.sh
Build PCNTL ext for MAMP PHP 7.1.1
# Command lines tools
xcode-select --install
# Install dependencies
brew install wget autoconf openssl libjpeg libpng lzlib curl imap-uw readline postgresql libxml2 mcrypt gettext libxslt homebrew/dupes/libiconv icu4c expat bison webp freetype
# Dirs
mkdir -p /Applications/MAMP/bin/php/php7.1.1/include
cd /Applications/MAMP/bin/php/php7.1.1/include
@ediamin
ediamin / CLI.php
Created July 7, 2018 07:28
WordPress CLI Wrapper Abstract Class
<?php
namespace MyPlugin\CLI;
/**
* Base CLI class contains wrapper APIs
*
* @since 1.0.0
*/
abstract class CLI extends \WP_CLI_Command {
@ediamin
ediamin / 1. README.md
Last active February 28, 2019 15:19
Vue.js design pattern to mimic WordPress' do_action
@ediamin
ediamin / dokan-reset-vendor-banner-and-gravatar.php
Created January 2, 2020 16:51
Dokan Reset All Vendor Banner and Gravatar
<?php
$vendors = dokan()->vendor->all();
foreach ( $vendors as $vendor ) {
$vendor->set_banner_id( 0 );
$vendor->set_gravatar_id( 0 );
$vendor->save();
}
@ediamin
ediamin / Assets.php
Created March 13, 2020 02:55
Using time() function in WordPress asset versioning for cache busting
<?php
namespace Vendor\Plugin;
class Assets {
// ...
public function register_scripts() {
$version = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? time() : MY_PLUGIN_VERSION;
@ediamin
ediamin / dokan_dashboard_nav_common_link.php
Last active August 1, 2020 17:42
Filter nav links in vendor dashboard sidebar menu at bottom
@ediamin
ediamin / AdbCommands
Created May 23, 2022 12:23 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader