Skip to content

Instantly share code, notes, and snippets.

View deifos's full-sized avatar

Vlad deifos

  • Montreal
View GitHub Profile
@deifos
deifos / setUpStripeSubscription.js
Created January 30, 2025 12:52 — forked from soulbliss/setUpStripeSubscription.js
Code to setup stripe subscriptions. Code credits to @marc_louvion
// app > api > webhook > stripe > js route.js -->
import { NextResponse } from 'next/server';
import { headers } from 'next/headers';
import Stripe from 'stripe';
import connectMongo from '@/libs/mongoose';
import User from '@models/User';
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
const webhookSecret = process.env.STRIPE_WEBHOOK_SECRET;
@deifos
deifos / firewall.sh
Created October 30, 2024 11:39 — forked from andrasbacsai/firewall.sh
Update a Hetzner Firewall rule with your IP address
#!/bin/bash
# Script to update a firewall rule in a Hetzner Firewall with your current IP address.
# Good if you would like to restrict SSH access only for your current IP address (secure).
#################
# WARNING: This script will overwrite all rules in the firewall rules, so make sure you
# added all the required rules.
# I use a separate firewall rule just for SSH access.
#################
@deifos
deifos / coverflow-animation.tsx
Created October 29, 2024 13:28 — forked from devalade/coverflow-animation.tsx
Coverflow animation
import { PropsWithChildren, useEffect, useState } from "react";
import { Container } from "~/components/container";
import { ArrowLeft, ArrowRight } from "lucide-react";
import { range } from "~/utils/range";
const IMAGES = [
{
id: 1,
url: "https://images.pexels.com/photos/1366919/pexels-photo-1366919.jpeg",
},