Skip to content

Instantly share code, notes, and snippets.

View netgfx's full-sized avatar
💻
Working...

Michael Dobekidis netgfx

💻
Working...
View GitHub Profile
@netgfx
netgfx / brevo-body.html
Last active January 3, 2025 13:27
An HTML body to send via Brevo
<!doctypehtml><html lang=en><meta charset=UTF-8><meta content="width=device-width,initial-scale=1"name=viewport><title>Project Interest</title><style>body,p,table,td{margin:0;padding:0;font-family:Arial,sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}table,td{border-collapse:collapse;mso-table-lspace:0;mso-table-rspace:0}@media only screen and (max-width:600px){.container{width:100%!important;max-width:100%!important}}</style><body style=margin:0;padding:0;background-color:#fff><table cellpadding=0 cellspacing=0 role=presentation width=100% style=background-color:#fff><tr><td style="padding:20px 0"align=center><table cellpadding=0 cellspacing=0 role=presentation width=100% style="max-width:700px;background-color:#f1f1f1;border:2px solid #000;padding:20px"><tr><td><table cellpadding=0 cellspacing=0 role=presentation width=100%><tr><td style="padding:0 8px"><span style=font-size:16px;color:#939599>Hi, my name is </span><span style=font-size:20px;color:#000>{{2.name}}</span> <span style=font-s
@netgfx
netgfx / Leaves.tsx
Created November 21, 2024 23:19
SeasonalParticles
import React, { useRef, useMemo } from "react";
import { Canvas, useFrame, useLoader } from "@react-three/fiber";
import { TextureLoader, Mesh, Group, Color, Texture } from "three";
import { OrbitControls } from "@react-three/drei";
interface LeafProps {
position: [number, number, number];
rotation: [number, number, number];
scale: number;
speed: number;
@netgfx
netgfx / logger.ts
Created February 2, 2024 09:15
typescript logger
/* modification of the logger https://github.com/mohitagrawal1305/nextjs-custom-logger/blob/main/helpers/logger.js */
/* typescript and small fix for nextjs usage */
/* use on your layout.tsx or high level provider
* declare global {
* interface Window {
* logger: any;
* }
* }
@netgfx
netgfx / stripe-tax-id-validation.js
Created December 22, 2023 13:31
Stripe TaxID validation function
// code is A.I generated, use with care
function isValidTaxId(taxId, country) {
let regex;
switch (country) {
case 'US':
// US EIN format: 00-0000000
regex = /^(\d{2}-\d{7})$/;
break;
case 'DE':
@netgfx
netgfx / useHLSVideoTexture.js
Created October 11, 2023 07:35
R3F HLS Video texture
import * as THREE from 'three'
import { useEffect, useRef } from 'react'
import { useThree } from '@react-three/fiber'
import { suspend, preload, clear } from 'suspend-react'
import Hls from 'hls.js'
export function useHLSVideoTexture(src, props) {
const { unsuspend, start, crossOrigin, muted, loop, ...rest } = {
unsuspend: 'loadedmetadata',
crossOrigin: 'Anonymous',
@netgfx
netgfx / animation.js
Created October 4, 2023 06:20 — forked from rtpHarry/animation.js
Three.js - play an AnimationAction in reverse. There are a bunch of threads saying this isn't possible but I found a way so I wanted to post it online in a place that people will hopefully stumble upon it.
// The class itself is based on the animation helper class in
// https://github.com/paulmg/ThreeJS-Webpack-ES6-Boilerplate
// but I have changed almost everything except for the class name and the update function.
import * as THREE from 'three';
export default class Animation {
constructor(scene, animations) {
this.scene = scene;
this.animations = animations;
@netgfx
netgfx / gist:6195da08cc46a23951749e0ab53633b3
Created July 31, 2023 13:39
Massively convert FBX files to GTLF on Windows
#!/bin/bash
input_folder="C:\Users\..."
output_folder="C:\Users\..."
for file in "$input_folder"/*; do
if [[ -f "$file" ]]; then
filename=$(basename -- "$file")
extension="${filename##*.}"
filename="${filename%.*}"
@netgfx
netgfx / Main.tsx
Created April 12, 2023 10:12
Framer + Supabase realtime (receiver)
import { ComponentType, useRef, useState } from "react"
import { useEffect } from "react"
import { createStore } from "https://framer.com/m/framer/store.js@^1.0.0"
import { randomColor } from "https://framer.com/m/framer/utils.js@^0.9.0"
import * as SupabaseJs from "https://jspm.dev/@supabase/supabase-js@rc"
import _ from "lodash"
// Learn more: https://www.framer.com/docs/guides/overrides/
export const useStore = createStore({
background: "#0099FF",
@netgfx
netgfx / Main.tsx
Created April 12, 2023 10:11
Framer + Supabase realtime (sender)
import { ComponentType, useRef, useState } from "react"
import { useEffect } from "react"
import { createStore } from "https://framer.com/m/framer/store.js@^1.0.0"
import { randomColor } from "https://framer.com/m/framer/utils.js@^0.9.0"
import * as SupabaseJs from "https://jspm.dev/@supabase/supabase-js@rc"
import _ from "lodash"
// Learn more: https://www.framer.com/docs/guides/overrides/
export const useStore = createStore({
@netgfx
netgfx / TextWrapper.tsx
Created November 28, 2022 16:57
Framer Text Wrapper
// Welcome to Code in Framer
// Get Started: https://www.framer.com/docs/guides/
import { addPropertyControls, ControlType } from "framer"
import { ScrambleText } from "./ScrambleText.tsx"
/**
* These annotations control how your component sizes
* Learn more: https://www.framer.com/docs/guides/auto-sizing
*