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 / 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
@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 / 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-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 / 1. README.md
Last active February 28, 2019 15:19
Vue.js design pattern to mimic WordPress' do_action
@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 / 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 / vue-computed-prop.js
Created March 16, 2018 14:58
Example of vue computed property
data() {
return {
questions: [
{
...
},
{
...
}
...
@ediamin
ediamin / install_lamp_16.sh
Created December 18, 2017 06:55 — forked from ankurk91/install_lamp_ubuntu.sh
Ubuntu 16.04 - PHP development (php 7.1, MySQL 5.7, apache 2.4)
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Ubuntu 16.04 Dev Server
# Run like - bash install_lamp.sh
# Script should auto terminate on errors
echo -e "\e[96m Adding PPA \e[39m"
sudo add-apt-repository -y ppa:ondrej/apache2
@ediamin
ediamin / gist:4e7c92c605690fc9ca56157f625c66d6
Created September 4, 2017 12:06 — forked from thomasgriffin/gist:4410690
JS used to customize the new media workflow for Soliloquy.
// Use the new media manager to handle uploads to Soliloquy.
$('#soliloquy-area').on('click.soliloquyUpload', '#soliloquy-upload', function(e){
// Prevent the default action from occuring.
e.preventDefault();
// Variable to hold our media applicaton.
var soliloquy_frame;
// If the media frame already exists, reopen it and return.
if ( soliloquy_frame ) {