Skip to content

Instantly share code, notes, and snippets.

//app/api/auth/[...nextauth]/route.ts
import { authOptions } from '@/lib/auth';
import NextAuth from 'next-auth';
const handler = NextAuth(authOptions);
export { handler as GET, handler as POST };
//lib/auth.ts
@rumitr
rumitr / findPermutations.js
Created April 28, 2021 21:10
given a word it returns all the permutations of the string
let findPermutations = (string) => {
if (!string || typeof string !== "string"){
throw new TypeError('Invalid string.');
}
if(string.length < 2 ) return [string]
let permutationsArray = []
for (let i = 0; i < string.length; i++){
@rumitr
rumitr / maxCharacter.js
Last active April 28, 2021 20:47
Given a string of characters, return the character that appears the most often. Example: input = "Hello World!" return "l"
var maxChar = (value) => {
if (typeof value !== 'string') {
throw new TypeError('The param should be a string')
} else if (!value) {
throw new Error('The param should be a valid string')
}
const occurrences = new Map();
const characters = value
@rumitr
rumitr / thirugram.js
Created November 13, 2018 10:05 — forked from scriptnull/thirugram.js
spam telegram via telegram web
//spam message the chats with thirugram.js
//open up telegram web and go to the chat you want to spam
//open console ( Ctrl + Shift + J )
//execute the code
var message = ""; //spam message
var interval = 1 ; // in seconds
var count = 10 ; //number of times to send
var notifyInterval = 5 ; //notify
var i = 0 ;
var timer = setInterval(function(){