Skip to content

Instantly share code, notes, and snippets.

View devkabir's full-sized avatar
🎯
Focusing

Dev Kabir devkabir

🎯
Focusing
  • Dhaka
View GitHub Profile
@devkabir
devkabir / InstallWpCli.ps1
Created September 28, 2023 05:22 — forked from czerspalace/InstallWpCli.ps1
Use Powershell to install wp-cli
$cliDir = "c:\wp-cli\"
mkdir $cliDir
$cliFilePath = $cliDir + "wp-cli.phar";
(New-Object System.Net.WebClient).DownloadFile("https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar", $cliFilePath)
$batchFile = $cliDir + "wp.bat";
Set-Content $batchFile "@ECHO OFF","php `"c:/wp-cli/wp-cli.phar`" %*"
#Need to set path here
@devkabir
devkabir / InstallWpCli.ps1
Created September 28, 2023 05:22 — forked from czerspalace/InstallWpCli.ps1
Use Powershell to install wp-cli
$cliDir = "c:\wp-cli\"
mkdir $cliDir
$cliFilePath = $cliDir + "wp-cli.phar";
(New-Object System.Net.WebClient).DownloadFile("https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar", $cliFilePath)
$batchFile = $cliDir + "wp.bat";
Set-Content $batchFile "@ECHO OFF","php `"c:/wp-cli/wp-cli.phar`" %*"
#Need to set path here
@devkabir
devkabir / test-composer-project-locally.md
Created December 26, 2022 04:51 — forked from wimvds/test-composer-project-locally.md
Test an existing composer project (create-project) locally

First, clone the repository of the project :

  mkdir /tmp/project-name
  git clone ...

Create a packages.json file in the root, containing the following :

@devkabir
devkabir / acf-notice.php
Created November 1, 2022 07:35 — forked from danielpataki/acf-notice.php
Admin Notices
if( !function_exists( 'the_field' ) && empty( get_option( 'my-acf-notice-dismissed' ) ) ) {
add_action( 'admin_notices', 'my_acf_admin_notice' );
}
function my_acf_admin_notice() {
?>
<div class="notice error my-acf-notice is-dismissible" >
<p><?php _e( 'ACF is not necessary for this plugin, but it will make your experience better, install it now!', 'my-text-domain' ); ?></p>
</div>
@devkabir
devkabir / acf-notice.php
Created November 1, 2022 07:35 — forked from danielpataki/acf-notice.php
Admin Notices
if( !function_exists( 'the_field' ) && empty( get_option( 'my-acf-notice-dismissed' ) ) ) {
add_action( 'admin_notices', 'my_acf_admin_notice' );
}
function my_acf_admin_notice() {
?>
<div class="notice error my-acf-notice is-dismissible" >
<p><?php _e( 'ACF is not necessary for this plugin, but it will make your experience better, install it now!', 'my-text-domain' ); ?></p>
</div>
@devkabir
devkabir / sample.md
Created November 18, 2021 04:26 — forked from reanim8ed/sample.md
[Mailhog in Laragon] #email #laragon #laragon
<?php
/*
Plugin Name: Add Item Meta & Order Meta for your WooComerce order
Description: A simple demo plugin on how to add add cart item meta & order item meta for your WooComerce order.
Author: Bhavik Kiri
Version: 1.0
*/
add_action( 'woocommerce_before_add_to_cart_button', 'add_fields_before_add_to_cart' );
@devkabir
devkabir / print_zpl.php
Created August 20, 2021 09:14 — forked from erighetto/print_zpl.php
Send raw ZPL to Zebra printer
<?php
error_reporting(E_ALL);
/* Get the port for the service. */
$port = "9100";
/* Get the IP address for the target host. */
$host = "172.17.144.89";
/* construct the label */
@devkabir
devkabir / extend-trial-jetbrains-windows.bat
Last active July 3, 2021 16:20
JetBrains IDE trial reset windows
REM Delete eval folder with licence key and options.xml which contains a reference to it
for %%I in ("WebStorm", "IntelliJ", "CLion", "Rider", "GoLand", "PhpStorm", "Resharper", "PyCharm") do (
for /d %%a in ("%USERPROFILE%\.%%I*") do (
rd /s /q "%%a/config/eval"
del /q "%%a\config\options\other.xml"
)
)
REM Delete registry key and jetbrains folder (not sure if needet but however)
rmdir /s /q "%APPDATA%\JetBrains"
@devkabir
devkabir / disallow-file-mods.php
Created June 28, 2021 17:03 — forked from yanknudtskov/disallow-file-mods.php
Disallow File Mods Be careful using this, as it will disable the ability to update both core, plugins and themes in the Wordpress Admin. It's very helpful for security or locking a website into a static version.
define('DISALLOW_FILE_MODS', true);