Skip to content

Instantly share code, notes, and snippets.

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

Michael Dobekidis netgfx

💻
Working...
View GitHub Profile
// 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"
@Pkawa
Pkawa / WebView.swift
Last active February 17, 2021 06:38
UIWebView implementation for SwiftUI
//
// WebView.swift
// Copyright © 2020 Piotr Kawa
// The MIT License
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
func loadData() {
guard let url = URL(string: "https://jsonplaceholder.typicode.com/todos") else {
print("Invalid URL")
return
}
let request = URLRequest(url: url)
URLSession.shared.dataTask(with: request) { data, response, error in
if let data = data {
if let response = try? JSONDecoder().decode([TaskEntry].self, from: data) {