Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Vaibhav Maheshwari vaibhavgeek

🎯
Focusing
View GitHub Profile
View Classes.H
//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
Your First SPA in ReactJs, NodeJS
View article.model
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
let Article = new Schema({
content: {
type: String
},
author: {
type: String
}
});
@vaibhavgeek
vaibhavgeek / proxy.cpp
Last active Jun 10, 2019
Why is this not working?
View proxy.cpp
#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; }
View flasktry.py
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
View gist:9295e23f1cbfcb086d51f57ff2e14795
# /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;
View 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
View 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 Jul 16, 2018
Sort Accorfing to string and integer type in Python
View gist:d6811a1c77f7d5b9da5ab3a92251dadb
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 Jun 17, 2018
Spectrum Color Picker Full
View spectrum.js
$("#icon_color").spectrum({
showInput: true,
className: "full-spectrum",
showInitial: true,
showPalette: true,
showSelectionPalette: true,
maxSelectionSize: 10,
preferredFormat: "hex",
localStorageKey: "spectrum.demo",
move: function (color) {
View answer.cpp
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll t;
cin>>t;
while(t--)
{
ll n;
cin>>n;