Skip to content

Instantly share code, notes, and snippets.

View Nick390's full-sized avatar
😃
I learned a lot this year

AlwaleedAlwabel Nick390

😃
I learned a lot this year
View GitHub Profile
@Nick390
Nick390 / disposable-email-domains.json
Last active November 5, 2023 16:09
More details can be found here about using the code https://stackoverflow.com/a/77426665/12324194 need more like this visit https://web.alwaleedalwabel.com/
This file has been truncated, but you can view the full file.
[
"0-180.com",
"0-30-24.com",
"0-420.com",
"0-900.com",
"0-aa.com",
"0-mail.com",
"0-z.xyz",
"0.mail.mujur.id",
"0.pbot.tk",
@Nick390
Nick390 / see_all_get_routers.js
Created October 28, 2023 00:00
If you have a node app and you like to print all the get routes in your app to see what user can go to you can use this code in index.js that will print all the routers to txt file
const fs = require("fs");
// Function to recursively find all routes
function listRoutes(router, parentPath = "", routeList = []) {
if (!router || !router.stack) {
console.error("Invalid router:", router);
return routeList;
}
router.stack.forEach((layer) => {
@Nick390
Nick390 / see_all_routers.js
Last active October 27, 2023 23:59
If you have a node app and you like to print all the routes in your app to see what user can go to you can use this code in index.js that will print all the routers to json file
// Function to recursively find all routes
function listRoutes(router, parentPath = "", routeList = []) {
if (!router || !router.stack) {
console.error("Invalid router:", router);
return routeList;
}
router.stack.forEach((layer) => {
if (layer.route) {
routeList.push({
@Nick390
Nick390 / generate_unique_id.js
Created September 16, 2023 23:38
generate unique id
function generate_unique_id(length) {
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
let result = '';
for (let i = 0; i < length; i++) {
const randomIndex = Math.floor(Math.random() * characters.length);
result += characters[randomIndex];
}
return result;
@Nick390
Nick390 / https.md
Last active December 26, 2022 21:39
How to set https on linode + godaddy + ubuntu + certbot + docker + nodejs + nginx

How to setup https on your website?

Before I start, I would like to tell you that this method has been tested on the following settings

  1. Hosting -> linode.com
  2. Operating system -> Ubuntu 20.04 LTS Disk
  3. Domain service provider -> godaddy.com
  4. Node app -> inside a docker container with port 5000:5000
  5. Mysql database -> inside a docker container with port 3306:3306
  6. nginx -> inside root not in docker container it's work like apache server
  7. certbot -> inside root not in docker container with python3
@Nick390
Nick390 / code.gs
Last active August 26, 2022 15:04
Permissions to access a page on google AppScript its's only for google workspace
/**
* This code allows you to access certain pages on Google Script.
* Let's say you have made a site on Google Script and want to prevent the user from accessing certain pages in the following code.
* You can do that
* How to use?
* First Create 2 tables in Google Sheet.
* In the first table you will have a column for the name of the rank and a second column for the name of the page in the column of the name of the rank put the name of the rank such as "admin" and the name of the page without spaces without capital letters Now put the word true in lowercase letters under page name so you will have 2 row in second table you will add user email and roll name
* Second call permissions("change_to_user_roll", "change_to_sheet_name", "change_to_column_number")[page_name].
* And it will return the result if true or false.