Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Vikas Kapadiya vikas5914

💭
I may be slow to respond.
View GitHub Profile
@vikas5914
vikas5914 / log.js
Last active Jul 4, 2020
Custom Logger Library with winston
View log.js
const { createLogger, format, transports } = require('winston')
const moment = require('moment')
// set default log level.
const logLevel = 'info'
var logger = createLogger({
level: logLevel,
levels: {
fatal: 0,
View disable-inspect.js
<script type="text/javascript">
eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(3(){(3 a(){8{(3 b(2){7((\'\'+(2/2)).6!==1||2%5===0){(3(){}).9(\'4\')()}c{4}b(++2)})(0)}d(e){g(a,f)}})()})();',17,17,'||i|function|debugger|20|length|if|try|constructor|||else|catch||5000|setTimeout'.split('|'),0,{}))
</script>
@vikas5914
vikas5914 / makeCert.bat
Created Jan 22, 2018
Generate a self-signed certificate for localhost
View makeCert.bat
@echo off
REM IN YOUR SSL FOLDER, SAVE THIS FILE AS: makeCERT.bat
REM AT COMMAND LINE IN YOUR SSL FOLDER, RUN: makecert
REM IT WILL CREATE THESE FILES: example.cnf, example.crt, example.key
REM IMPORT THE .crt FILE INTO CHROME Trusted Root Certification Authorities
REM REMEMBER TO RESTART APACHE OR NGINX AFTER YOU CONFIGURE FOR THESE FILES
REM PLEASE UPDATE THE FOLLOWING VARIABLES FOR YOUR NEEDS.
SET HOSTNAME=example
@vikas5914
vikas5914 / index.js
Created Feb 4, 2019
Exit App in React Navigation
View index.js
const AppNavigator = createStackNavigator(
{
Screen: Screen,
Login: Login,
Intro: Intro,
},
{
initialRouteName: 'Screen',
transitionConfig,
navigationOptions: {
View WooCommerce : Paypal for INR
add_filter('woocommerce_paypal_supported_currencies', 'add_aed_paypal_valid_currency');
function add_aed_paypal_valid_currency($currencies)
{
array_push($currencies, 'INR'); /* YOUR CURRENCY */
return $currencies;
}
add_filter('woocommerce_paypal_args', 'woocommerce_paypal_args_for_inr');
function woocommerce_paypal_args_for_inr($paypal_args)
{
@vikas5914
vikas5914 / pre-commit
Created Jul 14, 2017
Git Pre commit DB export hook
View pre-commit
#!/bin/bash
DBUSER=""
DBPASS=""
DB=""
SCHEMAPATH=""
DATE=$(date +"%d-%m-%Y-%H-%M-%p")
if [ ! -d "$SCHEMAPATH" ]; then
mkdir $SCHEMAPATH
fi
View keybase.md

Keybase proof

I hereby claim:

  • I am vikas5914 on github.
  • I am marcus5914 (https://keybase.io/marcus5914) on keybase.
  • I have a public key ASACov_9otsbe158tgJcrkAhT59diSCNZhqCzAmQOt6XBgo

To claim this, I am signing this object:

View function.php
function woocommerce_paypal_args_for_inr($paypal_args){
if ( $paypal_args['currency_code'] == 'currency_code'){
$convert_rate = currency_rate; // $1 = how much
$count = 1;
while( isset($paypal_args['amount_' . $count]) ){
$paypal_args['amount_' . $count] = round( $paypal_args['amount_' . $count] / $convert_rate, 2);
$count++;
}
@vikas5914
vikas5914 / noidea.php
Last active Dec 13, 2016
change currency_code and covert_rate
View noidea.php
function woocommerce_paypal_args_for_noidea($paypal_args){
if ( $paypal_args['currency_code'] == 'curreny_Code'){
$convert_rate = 50;
if (isset($paypal_args['tax_cart'])) {
$paypal_args['tax_cart'] = round($paypal_args['tax_cart'] / $convert_rate, 2);
}
if (isset($paypal_args['shipping_1'])) {
View paypal new fix.php
add_filter('woocommerce_paypal_supported_currencies', 'add_aed_paypal_valid_currency');
function add_aed_paypal_valid_currency($currencies)
{
array_push($currencies, 'INR'); /* YOUR CURRENCY */
return $currencies;
}
function woocommerce_paypal_args_for_inr($paypal_args)
{
if ($paypal_args['currency_code'] == 'INR') {
You can’t perform that action at this time.