Skip to content

Instantly share code, notes, and snippets.

View pitabas106's full-sized avatar

Pitabas Behera pitabas106

View GitHub Profile
@pitabas106
pitabas106 / google_app_scripts_send_email.js
Last active September 11, 2023 04:40
Google App Script to Send Email
// Fetch data from the spreadsheet
function fetchDataFromSheet() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var lastRow = sheet.getLastRow();
var data = [];
for (var i = 2; i <= lastRow; i++) {
var row = sheet.getRange("A" + i + ":L" + i).getValues()[0];
data.push({
empCode: row[0],
@pitabas106
pitabas106 / zeta-woo-change-quantity.php
Last active February 16, 2022 06:33
WooCommerce: Customers can change the quantity & delete it on checkout page.
<?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 September 20, 2019 03:29
Using this script you can minify the CSS and JS files.
#!/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...";
@pitabas106
pitabas106 / browser-specific-style.css
Created September 5, 2019 03:01
Browser specific 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 August 24, 2019 00:59
Instruction for Migrate WordPress Multisite

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 August 23, 2019 13:07
Recursively replacing a string in all files in a directory.
#!/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