Skip to content

Instantly share code, notes, and snippets.

@mohitkh7
mohitkh7 / file_with_milisecond_name.py
Created July 16, 2018 05:44
Python codefile to save file with name as timestamp of accuracy upto millisecond
# Python code to save a file with timestamp of accuracy upto millisecond
from datetime import datetime as dt
current_time = dt.now() # current system time e.g. 2018-07-16 16:34:43.050328
current_time_as_str = str(current_time)
filename = current_time_as_str + ".txt"
file = open(filename, "w+") # Create a empty text file with timestamp name
file.close()
@mohitkh7
mohitkh7 / pg_study.md
Last active July 5, 2018 13:16
Study & Analysis of Payment Gateway

Hosted vs Integrated Gateway

The integrated gateways let your buyers enter their payment data while they are on your website; the hosted gateways redirect users to the payment processor’s platform. An integrated gateway allows users to input their payment data without leaving your website. For them this is a seamless process. But this type of payment gateway will work well only if your website is secure enough, since all payment details will be stored on your server.

Payment Gateway Fees

  • Setup fee/registration fee (one-time payment);
  • monthly fee;
  • Transaction fee/payment processing fee/credit card processing fee (charged as a percentage or a fixed fee on every transaction);
  • Chargeback fee.
@mohitkh7
mohitkh7 / Analogy.md
Last active May 23, 2019 17:49
Collections of interesting analogies

Autorickshaw and Campus Opportunities

We all are just like Autorickshaws always looking for customers(opportunities). Its very good to have customer (opportunity) with you. If you don't have it keep on roaming keep on searching you will definately find one. But what about those rickshaws who just stay at rickshaw stops and don't roam around ? They are like one who is at IIT/NIT/IIM and passenger (opportunities) will themselves come up. But if you are not standing at such a rickshaw stand then keep wandering, just never stop. Coz you rickshaws made to be driven ( just like you are made to explore & struggle ). And remember even rickshaw standing at stand sometimes need to roam around in search of passenger. Just like top tier institute students sometimes need to look beyond in campus options to grab a certain opportunity. And remember if one customer(opportunity) comes but refuses to go along never be downhearted a next customer (opportunity) may be willing to travel longer distance will come soon.

TC

@mohitkh7
mohitkh7 / code.c
Last active April 29, 2018 03:25
Hardware code of Smart Irrigation System.
#include "ESP8266WiFi.h"
#include "ESP8266HTTPClient.h"
#include "ArduinoJson.h"
const int AnalogIn = A0;
const int Motor_Pin = D1;
const char* ssid = "JioFi3_1E8B14";
const char* password = "9d1u40ntfbb";
const char* host = "mohitkh7.pythonanywhere.com";