Skip to content

Instantly share code, notes, and snippets.

View jha-adrs's full-sized avatar
🎯
Focusing

Aadarsh Jha jha-adrs

🎯
Focusing
View GitHub Profile
'''Convert the same into a function
freq step value changed to 0.01 instead of 0.001
'''
import scipy.stats as stats
import datetime as dt
import matplotlib.pyplot as plt
import numpy as np
from numpy import pi, sqrt as isqrt, cos, sin
import random
import time
@jha-adrs
jha-adrs / mcmpproject.c
Created April 12, 2023 13:01
Project for interfacing GSM with 8051 using Proteus
#include<reg52.h>
#define display_port P1 //Data pins connected to port 2 on microcontroller
sbit rs = P2^0; //RS pin connected to pin 0 of port 2
sbit rw = P2^1; // RW pin connected to pin 1 of port 2
sbit e = P2^2; //E pin connected to pin 2 of port 2
int k;
int i;
unsigned char str[26];
unsigned char text_mode[9]="AT+CMGF=1";
@jha-adrs
jha-adrs / AllorNothing.sol
Created May 16, 2023 05:05
Solidity AllorNothing
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
contract AllorNothing {
address public owner;
mapping (address => uint256) public balances;
event Deposit(address indexed depositor, uint256 amount);
event Withdraw(address indexed withdrawer, uint256 amount);
error ZeroBalance();
constructor() {
import matplotlib.pyplot as plt
import concurrent.futures
import scipy.stats as stats
import datetime as dt
import time
import numpy as np
from numpy import cos, sin, sqrt as isqrt, pi
def calc_MA(da, kzA, pA, array_length=10):
@jha-adrs
jha-adrs / schema.prisma
Created February 2, 2024 13:50
AI Trainer Schema
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
@jha-adrs
jha-adrs / index.py
Created March 23, 2024 13:40
Firebase
from datetime import datetime
from firebase_admin import db, storage, credentials, initialize_app
from flask import Flask, request
# Import the constant from constants.py
server = Flask(__name__)
cread_obj = credentials.Certificate("./credentials.json")
firebaseApp = initialize_app(cread_obj, {
"databaseURL": "https://python-248f7-default-rtdb.firebaseio.com/"
@jha-adrs
jha-adrs / init.nvim
Created May 9, 2024 21:20
My neovim Config
:set number
:set autoindent
:set mouse=a
:set smarttab
:set tabstop=4
:set clipboard=unnamedplus
call plug#begin('~/.config/nvim/plugged')
const parseStringToHTML = (input: string) => {
const elements = [];
let tempStr: any = "";
let isBold = false;
const pushElement = (content: any, type: string) => {
if (content) {
if (type === "p") {
elements.push(<p key={elements.length} className="pt-2">{content}</p>);
} else if (type === "li") {