Skip to content

Instantly share code, notes, and snippets.

Avatar

Pitabas Behera pitabas106

View GitHub Profile
@pitabas106
pitabas106 / zeta-woo-change-quantity.php
Last active Jan 6, 2020
WooCommerce: Customers can change the quantity & delete it on checkout page.
View zeta-woo-change-quantity.php
<?php
/**
* WooCommerce: Customers can change the quantity & delete it on checkout page.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
@pitabas106
pitabas106 / minify-css-js.sh
Created Sep 20, 2019
Using this script you can minify the CSS and JS files.
View minify-css-js.sh
#!/bin/bash
#require: uglifyjs and uglifycss npm package
# https://www.npmjs.com/package/uglify-js
# https://www.npmjs.com/package/uglifycss
#Start JS minification
read -p 'Enter the unminified JS directory absolute path: ' JS_DIR
echo "Creating the minified directory...";
View browser-specific-style.css
/* Firefox */
@-moz-document url-prefix() {
body {
color: #f00;
}
}
/* Safari & Chrome */
@media screen and (-webkit-min-device-pixel-ratio:0) {
body {
@pitabas106
pitabas106 / migrate-wp-multisite-instructions.md
Last active Aug 24, 2019
Instruction for Migrate WordPress Multisite
View migrate-wp-multisite-instructions.md

Here are the basic steps to migrate

  1. Modify wp-config.php and .htaccess files.

  2. Modify the follwing database tables.

    • wp_options and wp_{blog_id}_options tables
      -- Change the fields site_url and home.

    • wp_blogs table\

@pitabas106
pitabas106 / replace-recursive.sh
Created Aug 23, 2019
Recursively replacing a string in all files in a directory.
View replace-recursive.sh
#!/bin/bash
#Define styls
RESET_STYLE=$(tput sgr0)
RED_COLOR=$(tput setaf 1)
GREEN_COLOR=$(tput setaf 2)
YELLO_COLOR=$(tput setaf 3)
BOLD=$(tput bold)
#Get the current OS name
You can’t perform that action at this time.