Skip to content

Instantly share code, notes, and snippets.

@RIGIK93
RIGIK93 / gcd.rs
Last active June 11, 2023 01:24
Euclidean algorithm for computing greatest common divisor in rust
use num::traits::{Zero, Rem};
fn gcd<T>(a: T, b: T) -> T
where
T: Zero + Rem<Output = T> + std::cmp::PartialEq + Copy,
{
if b == T::zero() {
return a;
}
gcd(b, a % b)
@RIGIK93
RIGIK93 / Programming Club.md
Created September 28, 2022 03:20
Programming Club

Programming club preparation:

Typescript

  • Hello World
  • variable declaration
  • Functions
    • Functions
    • Lambda
  • Types
    • number
    • boolean
@RIGIK93
RIGIK93 / email-verify-bot.md
Last active September 20, 2022 02:31
Email Verification Bot For Discord (Concept)

Email verification bot for discord

Tech Stack

Database: Surreal DB
Host: Docker
Lang: TS, node
Communication: RabbitMQ
Mailing Service: MailGun
Web Server: SvelteKit (Prefferable)/SolidJS SSR
@RIGIK93
RIGIK93 / subdomain-emulation.md
Last active September 18, 2022 15:29
subdomain-emulation

What is the idea?

I want to simulate ports on subdomains while having only one dynamic ip. This will allow to use full potential of the router.

How does it work (Draft)?

Step 1

  • Client makes a request to your custom dns.
  • Then dns gives the client ip to your router
  • dns makes a db query with user's dynamic ip (user: (user's IP) domain: (domain user wants to access (ex. darklynx.org or - - something.darklynx.org))

Step 2

Then when traffic reaches your router it goes through ngnix or some other service that'll re-translate your traffic according to json file:

  1. client reaches router and wants to access specific port