Skip to content

Instantly share code, notes, and snippets.

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

Michael Dobekidis netgfx

💻
Working...
View GitHub Profile
@otanodesignco
otanodesignco / twirl.glsl
Created October 1, 2024 04:17
Twirl function for glsl ported from unity shader graph node
vec2 twirl( vec2 uv, vec2 center, float strength, vec2 offset )
{
vec2 delta = uv - center;
float angle = strength * length(delta);
float x = cos(angle) * delta.x - sin(angle) * delta.y;
float y = sin(angle) * delta.x + cos(angle) * delta.y;
return vec2(x + center.x + offset.x, y + center.y + offset.y);
}
@chrisbu
chrisbu / gist:687cafefb87e0ddb3cb2d73301a9c64d
Last active November 11, 2024 11:42
Install LLAMA CPP PYTHON in WSL2 (jul 2024, ubuntu 24.04)
# Might be needed from a fresh install
sudo apt update
sudo apt upgrade
sudo apt install gcc
# Might be needed, per: https://docs.nvidia.com/cuda/wsl-user-guide/index.html#cuda-support-for-wsl-2
sudo apt-key del 7fa2af80
// Created by Anderson Mancini 2023
// React Three Fiber AutoFocus Component to be used
// as an extension for default Depth Of Field from react-three/postprocessing
// HOW TO USE?
// import AutoFocusDOF from './AutoFocusDOF'
//
// And add this component inside the EffectsComposer...
//...
// <EffectComposer>
@netgfx
netgfx / kruskals.rb
Created June 27, 2022 14:49 — forked from jamis/kruskals.rb
An implementation of Kruskal's algorithm for generating mazes.
# --------------------------------------------------------------------
# An implementation of Kruskal's algorithm for generating mazes.
# Fairly expensive, memory-wise, as it requires memory proportional
# to the size of the entire maze, and it's not the fastest of the
# algorithms (what with all the set and edge management is has to
# do). Also, the mazes it generates tend to have a lot of very short
# dead-ends, giving the maze a kind of "spiky" look.
# --------------------------------------------------------------------
# NOTE: the display routine used in this script requires a terminal
# that supports ANSI escape sequences. Windows users, sorry. :(
@netgfx
netgfx / Input.tsx
Created June 7, 2022 09:56
Framer input
import * as React from "react"
// @ts-ignore
import { ControlType, addPropertyControls, RenderTarget, withCSS } from "framer"
import { useState, useCallback, useEffect, useRef, useMemo } from "react"
import {
fontStack,
fontControls,
fontSizeOptions,
useOnEnter,
useFontControls,
@netgfx
netgfx / MasonryLayout.tsx
Last active February 25, 2024 00:13
Framer Masonry (pinterest layout)
import { useEffect, useState } from "react"
import { motion, Variants } from "framer-motion"
import { addPropertyControls, ControlType } from "framer"
import React from "react"
// Welcome to Code in Framer
// Get Started: https://www.framer.com/docs/guides/
export function useMediaQuery(query) {
const [matches, setMatches] = useState(false)
@dahabit
dahabit / ios_clean.sh
Last active February 26, 2022 23:03
Shell file that clean any Pods or Flutter dependencies before build
#!/bin/sh
echo "========== Cleanup start =========="
rm -Rf ios/Pods
rm -Rf ios/.symlink
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
rm -rf ios/Podfile.lock
rm -rf ~/Library/Developer/Xcode/DerivedData/* -y
rm -rf pubspec.lock
flutter clean
@roy-t
roy-t / MatrixMath.cs
Created February 6, 2021 14:37
Constructing a billboard Matrix - MonoGame version
// Based on: https://swiftcoder.wordpress.com/2008/11/25/constructing-a-billboard-matrix/
public static Matrix CreateBillboard(Vector3 position, Matrix view)
{
var result = Matrix.Identity;
result.Translation = position;
result.M11 = view.M11;
result.M12 = view.M21;
result.M13 = view.M31;
result.M21 = view.M12;
@netgfx
netgfx / battlehowls.js
Created January 12, 2021 14:24
battle howls
var battleHowls = [
"PAM!",
"BAM!",
"BANG!",
"BIFF!",
"BLOOP!",
"BONK!",
"CLASH!",
"CRASH!",
"KAPOW!",
@netgfx
netgfx / countdowncomponent.tsx
Last active October 12, 2023 17:31
Framer countdown
import * as React from "react"
import {
Frame,
addPropertyControls,
ControlType,
useMotionValue,
useAnimation,
animate,
Color,
} from "framer"