Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Vikas Kapadiya vikas5914

💭
I may be slow to respond.
Block or report user

Report or block vikas5914

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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: {
@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 / 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:

@vikas5914
vikas5914 / log.js
Created Jan 31, 2017
Custom Logger Library with winston
View log.js
var winston = require('winston')
// set default log level.
var logLevel = 'info'
// Set up logger
var customColors = {
trace: 'white',
debug: 'green',
info: 'blue',
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') {
@vikas5914
vikas5914 / index.php
Created May 28, 2016
Fix Some Noob's code
View index.php
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once('facebook/src/Facebook/autoload.php');
// some settings you might want to change
$params = array(
"app_id" => "xxxxxxxxxxxxxxxxxxxxx",
"app_secret" => "xxxxxxxxxxxxxxxxxxx",
"page_id" => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
@vikas5914
vikas5914 / fix.bash
Created May 25, 2016
Patching ImageMagick vulnerability
View fix.bash
if [ -f /etc/ImageMagick/policy.xml ]
then
if [ ! -f /etc/ImageMagick/patch.txt ]
echo -e "\t<policy domain="coder" rights="none" pattern="EPHEMERAL" />\n\t<policy domain="coder" rights="none" pattern="URL" />\n\t<policy domain="coder" rights="none" pattern="HTTPS" />\n\t<policy domain="coder" rights="none" pattern="MVG" />\n\t<policy domain="coder" rights="none" pattern="MSL" />" >> /etc/ImageMagick/patch.txt
sed -i '/<policymap>/r /etc/ImageMagick/patch.txt' /etc/ImageMagick/policy.xml
fi
fi
You can’t perform that action at this time.