Skip to content

Instantly share code, notes, and snippets.

View chandra10207's full-sized avatar
🏠
Working from home

Chandra Shekhar Pandey chandra10207

🏠
Working from home
View GitHub Profile
@chandra10207
chandra10207 / github-action-ssh.md
Created April 7, 2023 11:21 — forked from raviagheda/github-action-ssh.md
Github Action with EC2 using SSH
@chandra10207
chandra10207 / phpunit-assertions.md
Created February 10, 2023 02:53 — forked from briankip/phpunit-assertions.md
A list of PHPUnit assertions
  • assertArrayHasKey
  • assertArrayNotHasKey
  • assertContains
  • assertAttributeContains
  • assertNotContains
  • assertAttributeNotContains
  • assertContainsOnly
  • assertAttributeContainsOnly
  • assertNotContainsOnly
  • assertAttributeNotContainsOnly

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

Source

Vim Commands Cheat Sheet


How to Exit

:q[uit]

@chandra10207
chandra10207 / woo-product-attributes-bulk-modifier.php
Created May 1, 2022 23:50 — forked from birgire/woo-product-attributes-bulk-modifier.php
WordPress: WooCommerce Product Attributes - Bulk Modifier ( from custom meta attributes to taxonomy attributes)
<?php
/**
* Plugin Name: WooPAM: Woo Product Attributes Modifier
* Description: Bulk update 'custom meta product attributes' to 'taxonomy product attributes' in WooCommerce. Supports the GET variables, like: woopam_mode=run&woopam_from_attribute_meta=colour&woopam_to_attribute_tax=pa_colour&woopam_keep_attribute_meta&woopam_posts_per_page=10&woopam_paged=0&woopam_post_type=product&woopam_post_status=any. WARNING: Backup DB first!!!
* Plugin Author: birgire
* Author URI: https://github.com/birgire
* Plugin URI: https://gist.github.com/birgire/0ed300ae4436fcaf508c
* Version: 1.0.0
* License: GPL2+
* Text Domain: woopam
@chandra10207
chandra10207 / wp.sh
Created February 26, 2020 10:37 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@chandra10207
chandra10207 / wp_disable_passgenerator.php
Created January 19, 2018 04:30
When resetting passwords in WordPress a random password is automatically generated and pre-filled in the password field. to disable random password for password resets use this code.
add_filter( 'random_password', 'itsg_disable_random_password', 10, 2 );
function itsg_disable_random_password( $password ) {
$action = isset( $_GET['action'] ) ? $_GET['action'] : '';
if ( 'wp-login.php' === $GLOBALS['pagenow'] && ( 'rp' == $action || 'resetpass' == $action ) ) {
return '';
}
return $password;
@chandra10207
chandra10207 / functions.php
Created December 1, 2017 01:23 — forked from bentasm1/functions.php
WC Vendors Pro - Add new tabs to Pro Dashboard Navigation
/* WC Vendors Pro - Add some new page links to the Pro Dashboard */
function new_dashboard_pages( $pages ){
$pages[] = array( 'label' => 'New Link', 'slug' => 'http://mysomelink.com' ); // Add stuff here
return $pages;
}
add_filter( 'wcv_pro_dashboard_urls', 'new_dashboard_pages' );
@chandra10207
chandra10207 / functions.php
Created August 31, 2017 09:20 — forked from bentasm1/functions.php
Custom Taxonomy
<?php
// This code goes in your theme's functions.php
function form_caracteristica( $object_id ) {
WCVendors_Pro_Form_helper::select( array(
'post_id' => $object_id,
'id' => 'wcv_custom_product_caracteristicas',
'class' => 'select2',
'label' => __('Caracteristicas', 'wcvendors-pro'),
'show_option_none' => __('Select a caracteristicas', 'wcvendors-pro'),