This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script can be used to switch off some features from the configuration file. | |
# Usage: | |
# ./toggle_prefix.sh filename prefix num_lines | |
# Example: | |
# ./toggle_prefix.sh yourfile.txt ";" 4 | |
# Default values |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var customJS = document.createElement('script'); | |
customJS.type = 'text/javascript'; | |
customJS.async = true; | |
customJS.onload = function() {console.log("loaded")}; | |
customJS.src = 'custom.js'; | |
var scriptDom = document.getElementsByTagName('script')[0]; | |
scriptDom.parentNode.insertBefore(customJS, scriptDom); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Runnning Android Emulator without opening Android Studio | |
:: Before Running this batch script, make sure ANDROID_HOME environment variable is configured | |
:: This script will run your first virtual device listed by -list-avds | |
ECHO OFF | |
TITLE Run Android Emulator | |
set path_to_emulator_dir=%ANDROID_HOME%\emulator\ | |
CD /D %path_to_emulator_dir% | |
emulator -list-avds > temp.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run the file - python reorder-pdf-file-python-script.py <input-filename> <output-filename> | |
# Reference from geeksforgeeks - https://www.geeksforgeeks.org/working-with-pdf-files-in-python/ | |
# Used Python Library - PyPDF2 and sys | |
import PyPDF2 | |
import sys | |
def PDFmerge(pdfs, output): | |
# creating pdf file merger object | |
pdfMerger = PyPDF2.PdfFileMerger() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
//Type php_br for the snippet to work | |
"Php Debug Break": { | |
"prefix" : "php_br", | |
"body": ["echo \"<br/>\";", | |
"echo \"\";", | |
"echo \"<br/>\";" | |
], | |
"description": "Echo statement for debug purpose in php" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
//Type html_setup/html_jquery_setup for the snippet to work | |
"Html Setup Code": { | |
"prefix" : "html_setup", | |
"body": ["<html>", | |
"\t<head>", | |
"\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">", | |
"\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />", | |
"\t\t<title>Page Title</title>", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PyPDF2 | |
import os | |
#list all the files in the directory | |
files = os.listdir("pdffile") | |
for file in files: | |
#check if the file is pdf, if not skip the file | |
if ".pdf" not in file: | |
continue | |
#open the pdf file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Ip = 500, // Payable IGST | |
Cp = 500, // Payable CGST | |
Sp = 500, // Payable SGST | |
Ic = 200, // IGST Credit | |
Cc = 400, // CGST Credit | |
Sc = 700; // SGST Credit | |
// Calculate Tax as per Section 88(A) | |
function calculateTaxToBePaid(Ip,Cp,Sp,Ic,Cc,Sc) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add the below code to your theme's functions.php | |
/*'woocommerce_get_shop_coupon_data' is used to add virtual coupon*/ | |
add_filter('woocommerce_get_shop_coupon_data', 'addVirtualCouponDiscount', 10, 2); | |
add_action('woocommerce_cart_calculate_fees', 'addCoupontoCart'); | |
function addVirtualCouponDiscount($data, $coupon_code) { | |
if($coupon_code == "virtual_coupon") { | |
$coupon = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('default_checkout_billing_country', 'change_default_checkout_country'); | |
function change_default_checkout_country($county_code) { | |
return empty($county_code) ? 'XX' : $county_code ; // 'XX' is the default country code if there is no country code passed on to the filter (if user has saved billing country). | |
} |