Skip to content

Instantly share code, notes, and snippets.

View ashwaniYDV's full-sized avatar
:octocat:
अगर हारने से डर लगता है, तो जीतने की इच्छा कभी मत रखना

Ashwani Yadav ashwaniYDV

:octocat:
अगर हारने से डर लगता है, तो जीतने की इच्छा कभी मत रखना
View GitHub Profile
// C++ program to demonstrate auto-complete feature
// using Trie data structure.
#include<bits/stdc++.h>
using namespace std;
// Alphabet size (# of symbols)
#define ALPHABET_SIZE (26)
// Converts key current character into index
// use only 'a' through 'z' and lower case
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active May 6, 2024 13:21
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

import matlab.engine
import matplotlib.pyplot as plt
class SimulinkPlant:
def __init__(self,modelName = 'plant'):
self.modelName = modelName #The name of the Simulink Model (To be placed in the same directory as the Python Code)
#Logging the variables
self.yHist = 0
self.tHist = 0
class PIController:
def __init__(self):
#Maintain a History of Variables
self.yHist = []
self.tHist = []
self.uHist = []
self.eSum = 0
def initialize(self):
class SimulinkPlant:
def __init__(self,modelName = 'plant'):
self.modelName = modelName #The name of the Simulink Model (To be placed in the same directory as the Python Code)
#Logging the variables
self.yHist = 0
self.tHist = 0
def setControlAction(self,u):
#Helper Function to set value of control action

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@SoutrikBandyopadhyay
SoutrikBandyopadhyay / component.c
Created August 7, 2018 17:38
The Code for Symetrical Analysis of Unsymetric 3 Phase System
#include <stdio.h>
#include <math.h>
#include <malloc.h>
float pi = 3.141592654;
typedef struct _cmp{
float real;
float imag;
} Complex;
@ar-pa
ar-pa / BigInt.cpp
Last active October 24, 2023 09:30
bignum class for C++
// In the name of Allah.
// We're nothing and you're everything.
// Ya Ali!
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e2 + 14, lg = 15;
@zlorb
zlorb / linux_fun.md
Last active April 12, 2024 22:40 — forked from marianposaceanu/linux_fun.md
How to have some fun using the terminal.

Linux fun-o-matic

How to have some fun using the terminal.

  1. Install cowsay [0] via : sudo apt-get install cowsay
  2. Install fortune [1] via : sudo apt-get install fortune
  3. Install figlet [3] via : sudo apt-get install figlet
  4. Make sure you have Ruby installed via : ruby -v
  5. Install the lolcat [2] via : gem gem install lolcat
  6. (option) Add to .bash_profile and/or .bashrc