Skip to content

Instantly share code, notes, and snippets.

function initLoader() {
function draw( threshold ) {
for( var j = 0; j < srcBuf8.length; j += 4 ) {
var c = imgBuf8[ j ] + imgBuf8[ j + 1 ] + imgBuf8[ j + 2 ];
c /= 3;
dstBuf8[ j ] = c;
dstBuf8[ j + 1 ] = c;
import {
MotionValue,
useAnimationFrame,
useMotionValue,
} from "framer-motion";
import React from "react";
export interface Clock {
value: MotionValue<number>;
setRate: (rate: number) => void;
@cassidoo
cassidoo / mergerefs.jsx
Created January 10, 2023 22:57
Merge refs in React so a component can have more than one ref
export function mergeRefs(refs) {
return (value) => {
refs.forEach((ref) => {
if (typeof ref === "function") {
ref(value);
} else if (ref != null) {
ref.current = value;
}
});
};
@stammy
stammy / ContentView.swift
Created January 4, 2022 02:54
Better Password Field
//
// ContentView.swift
// BetterPasswordField
//
// Created by Paul Stamatiou on 1/3/22.
// Idea from https://twitter.com/Stammy/status/1478108590066089987
//
import SwiftUI
@Alucard-Jay
Alucard-Jay / BasicFPCC.cs
Last active November 17, 2025 09:23
A basic first person character controller for Unity3D
// ------------------------------------------
// BasicFPCC.cs
// a basic first person character controller
// with jump, crouch, run, slide
// 2020-10-04 Alucard Jay Kay
// ------------------------------------------
// source :
// https://forum.unity.com/threads/a-basic-first-person-character-controller-for-prototyping.1169491/
// Brackeys FPS controller base :
@jordienr
jordienr / Gradient.js
Created September 12, 2021 00:23
Stripe Mesh Gradient WebGL
/*
* Stripe WebGl Gradient Animation
* All Credits to Stripe.com
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and
* commented out for now.
* https://kevinhufnagl.com
*/
@jordansinger
jordansinger / iPod.swift
Created July 27, 2020 21:19
Swift Playgrounds iPod Classic
import SwiftUI
import PlaygroundSupport
struct iPod: View {
var body: some View {
VStack(spacing: 40) {
Screen()
ClickWheel()
Spacer()
}
@vibrazy
vibrazy / ColorPickerStorageExample.swift
Last active January 28, 2023 18:19
SwiftUI `ColorPicker` load and save values to disk using `AppStorage`
//
// ContentView.swift
// Shared
//
// Created by Dan Tavares on 01/07/2022.
// More Info: https://nilcoalescing.com/blog/EncodeAndDecodeSwiftUIColor/
import SwiftUI
#if os(iOS)
@MichaelCurrin
MichaelCurrin / README.md
Last active December 1, 2025 08:50
GitHub GraphQL - Get Pull Requests using GH's GraphQL API

Get Pull Requests using GH's GraphQL API

How to get Pull Requests data using GitHub in the browser, or using the API to allow for automating reporting or building in values into a website.

Resources

@ryonakae
ryonakae / chromaticAberrationFilter.frag
Created June 20, 2019 09:37
PixiJS chromatic aberration filter
precision mediump float;
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform vec2 uResolution; // app.screen
uniform vec2 uMouse; // -1.0 ~ 1.0
uniform vec2 uRed;
uniform vec2 uGreen;
uniform vec2 uBlue;