Skip to content

Instantly share code, notes, and snippets.

View vaibhavgeek's full-sized avatar
🎯
Focusing

Vaibhav Maheshwari vaibhavgeek

🎯
Focusing
View GitHub Profile
@vaibhavgeek
vaibhavgeek / indexer.py
Created July 14, 2022 13:22
Zesty Indexer by @JSeam
import os
import asyncio
import json
import logging
import traceback
import requests
from datetime import datetime
from tortoise import Tortoise
from web3 import Web3, HTTPProvider, exceptions
@vaibhavgeek
vaibhavgeek / Classes.H
Created June 15, 2020 14:18
Thesis Work
//three class definitions for:
// - Primitive variables (W)
// - Conservative variables (U)
// - Conservative fluxes (F)
class Prim{
public:
Prim(double, double, double, double, double, double);
double rho1;
double rho2;
@vaibhavgeek
vaibhavgeek / article.model
Last active May 18, 2020 11:28
Your First SPA in ReactJs, NodeJS
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
let Article = new Schema({
content: {
type: String
},
author: {
type: String
}
});
@vaibhavgeek
vaibhavgeek / proxy.cpp
Last active June 10, 2019 08:40
Why is this not working?
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll t;
cin>>t;
while(t--){
ll n;
cin>>n;
if(n <= 4) { cout<<-1<<endl; break; }
@vaibhavgeek
vaibhavgeek / flasktry.py
Created February 1, 2019 12:55
Smart Mirror
from flask import Flask, render_template, request
import json
from flask_cors import CORS
import numpy as np
import cv2 # Library for image processing
from math import floor
import threading
from http.server import BaseHTTPRequestHandler,HTTPServer
from socketserver import ThreadingMixIn
from io import StringIO,BytesIO
# /etc/nginx/sites-enabled/some.domain
# Change the server name {some.domain}
# Change the {host.of.notebook} and {port} in the following locations
server {
listen 80;
# Change the server name {some.domain}
server_name some.domain;
location / {
# Change the {host.of.notebook} and {port}
proxy_pass http://host.of.notebook:port;
@vaibhavgeek
vaibhavgeek / apple.txt
Created October 17, 2018 18:10
apple.txt
Apple Inc. is an American multinational technology company headquartered in Cupertino, California, that designs, develops, and sells consumer electronics, computer software, and online services. The company's hardware products include the iPhone smartphone, the iPad tablet computer, the Mac personal computer, the iPod portable media player, the Apple Watch smartwatch, the Apple TV digital media player, and the HomePod smart speaker. Apple's software includes the macOS and iOS operating systems, the iTunes media player, the Safari web browser, and the iLife and iWork creativity and productivity suites, as well as professional applications like Final Cut Pro, Logic Pro, and Xcode. Its online services include the iTunes Store, the iOS App Store and Mac App Store, Apple Music, and iCloud.
Apple was founded by Steve Jobs, Steve Wozniak, and Ronald Wayne in April 1976 to develop and sell Wozniak's Apple I personal computer. It was incorporated as Apple Computer, Inc., in January 1977, and sales of its computers, i
@vaibhavgeek
vaibhavgeek / whatsapp.js
Created July 24, 2018 16:58
whatsapp.js
function isChatMessage(message) {
if (message.__x_isSentByMe) {
return false;
}
if (message.__x_isNotification) {
return false;
}
if (!message.__x_isUserCreatedType) {
return false;
}
@vaibhavgeek
vaibhavgeek / gist:d6811a1c77f7d5b9da5ab3a92251dadb
Created July 16, 2018 09:06
Sort Accorfing to string and integer type in Python
test_files = os.listdir(f'{PATH}/test')
import re
def atoi(text):
return int(text) if text.isdigit() else text
def natural_keys(text):
return [ atoi(c) for c in re.split('(\d+)', text) ]
test_files.sort(key=natural_keys)
@vaibhavgeek
vaibhavgeek / spectrum.js
Created June 17, 2018 11:54
Spectrum Color Picker Full
$("#icon_color").spectrum({
showInput: true,
className: "full-spectrum",
showInitial: true,
showPalette: true,
showSelectionPalette: true,
maxSelectionSize: 10,
preferredFormat: "hex",
localStorageKey: "spectrum.demo",
move: function (color) {