Skip to content

Instantly share code, notes, and snippets.

View dayitv89's full-sized avatar
🎢
Rising

Gaurav D. Sharma dayitv89

🎢
Rising
View GitHub Profile
//
// AurusViewController.m
// AurusPayment
//
// Created by Gaurav D. Sharma on 06/09/22.
//
//
// replace <subdomain_provided_by_aurus>,<MerchantIdentifier>,<StoreId>,<TerminalId>,<AlternatePaymentMatrix>,<CorpID> with given credential
// use card details: 4111 1111 1111 1111, any future expire, any security code, any cardholder name
// debug WKWebKit => Safari -> Develop -> Simulator -> Open page
@dayitv89
dayitv89 / README.md
Created September 6, 2022 14:38 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@dayitv89
dayitv89 / A.js
Last active September 5, 2022 16:37
Prototype constructor in javascript / node.js
//node A.js > output.txt
// If Rabbit had any custom properties on it
// (or static properties as some call it), they would not be copied, you'd have to do that manually using getOwnPropertyNames
// ref: https://stackoverflow.com/a/9267343/1084917
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames
// var oldProto = Rabbit.prototype;
// Rabbit = function() {...};
// Rabbit.prototype = oldProto;
@dayitv89
dayitv89 / index.html
Last active September 6, 2022 12:44
Harry Potter stick as luminous effect (prakashit bhava)
<html>
<head>
<style>
html,
body {
width: 100%;
height: 100%;
margin: 0;
}
@dayitv89
dayitv89 / adonis5Index.js
Last active August 18, 2022 23:27
AdonisJS-5 direct run node index.js instead of server.ts as node ace serve
/*
|--------------------------------------------------------------------------
| AdonisJs Server
|--------------------------------------------------------------------------
|
| node adonis5Index.js
|
*/
require('reflect-metadata')
@dayitv89
dayitv89 / registerServiceWorker.ts
Last active July 19, 2022 15:38
vue.js react.js or any PWA for service worker cache updates use this.
/* eslint-disable no-console */
import { register } from "register-service-worker";
if (process.env.NODE_ENV === "production") {
register(`${process.env.BASE_URL}service-worker.js`, {
registrationOptions: { scope: './' },
ready() {
console.log("App is being served from cache by a service worker. For more details, visit https://goo.gl/AFskqB");
},
@dayitv89
dayitv89 / replaceAll.js
Created June 9, 2022 15:20
javascript replaceAll for node version < 15
//node version < 15
if (!String.prototype.replaceAll) {
String.prototype.replaceAll = function (str, newStr) {
// If a regex pattern
if (Object.prototype.toString.call(str).toLowerCase() === '[object regexp]') {
return this.replace(str, newStr);
}
// If a string
return this.split(str).join(newStr);
@dayitv89
dayitv89 / package.json
Last active May 14, 2022 01:06
Transform mysql 8 data into mongodb;
{
"dependencies": {
"mongodb": "^4.6.0",
"mysql2": "^2.3.3"
}
}
@dayitv89
dayitv89 / get.json
Created February 22, 2022 21:46
GST details like state codes and rates
{
"rates": {
"0": {
"full": 0,
"half": 0
},
"5": {
"full": 5,
"half": 2.50
},
@dayitv89
dayitv89 / README.md
Last active January 25, 2022 14:46
Mongo, Mongo UI, Redis, MySQL, Kafka, Kafka UI for local development, just run `docker-compose up -d` and remove by `docker-compose down`

For Apple M1 chip see issue

git clone https://github.com/faberchri/fast-data-dev.git
cd fast-data-dev
docker build -t faberchri/fast-data-dev .

Finally run docker-compose up -d and it will working fine on apple M1 chip.