Skip to content

Instantly share code, notes, and snippets.

View SiddharthManthan's full-sized avatar

Siddharth Manthan SiddharthManthan

View GitHub Profile
const jwt = require('jsonwebtoken');
const User = require('../models/User');
const requireAuth = (req, res, next) => {
const token = req.cookies.jwt;
// Check json web token exists and is verified
if(token) {
jwt.verify(token, process.env.JWTSECRET, (err, decodedToken) => {
if(err) {
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>My test page</title>
<style>
form {
import java.util.Scanner;
public class ArmStrongNumber {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
int result=0;
int sum=0;
int num=0;
int cube=0;
## Version 2021/04/27 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/default
error_page 502 /502.html;
# redirect all traffic to https
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
## Version 2021/05/18
# make sure that your dns has a cname set for heimdall
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name heimdall.*;
include /config/nginx/ssl.conf;
#include <iostream>
void decimalToBinary(int n)
{
while (n != 0)
{
std::cout << n % 2;
n = n / 2;
}
}
#include <iostream>
bool isPrime(int n)
{
bool isPrime = true;
for (int i = 2; i < n; i++)
{
if (n % i == 0)
{
isPrime=false;
@SiddharthManthan
SiddharthManthan / leapYear.py
Created February 16, 2022 17:45
Find leap year
def leap_year(year):
if year % 4 == 0:
if year % 100 == 0:
if year % 400 == 0:
print("It's a leap year.")
else:
print("It's not a leap year.")
else:
print("It's a leap year.")
public class Patterns {
public static void main(String[] args) {
int n = 5;
for (int i = 0; i <= n; i++) {
for (int space=n-i; space >= 1; space--) {
System.out.print(" ");
}
printNumbers(0, i);
}
for (int i = n-1; i >= 0; i--) {
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Scanner;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/