Skip to content

Instantly share code, notes, and snippets.

Beziangels

I was building some bezier interpolation code and half way through I settled on these jiggling creatures

A Pen by Matthew Willox on CodePen.

License.

@mwmwmw
mwmwmw / CompleteMinter.sol
Created January 27, 2023 17:56
A self-contained NFT minting contract
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
@mwmwmw
mwmwmw / MultiBandAnalyzer.js
Created June 3, 2022 18:02
Multi-Band Analyzer
import VuMeter from "./VuMeter";
export const DEFAULT_CONFIG = [
{
filter: {
frequency: 250,
Q: 3,
type: "lowpass"
},
compressor: {
@mwmwmw
mwmwmw / vumeter.js
Last active June 3, 2022 18:07
VU Meter Audio Worklet
export default class VUMeterNode extends AudioWorkletNode {
constructor(context, updateIntervalInMS = 16.67) {
super(context, "vumeter", {
numberOfInputs: 1,
numberOfOutputs: 0,
channelCount: 1,
processorOptions: {
updateIntervalInMS
}
});
@mwmwmw
mwmwmw / phasescope.js
Last active June 3, 2022 18:06
Phasescope Audio Worklet
export default class PhaseScope extends AudioWorkletNode {
constructor(context, updateIntervalInMS = 16.67) {
super(context, 'phasescope', {
numberOfInputs: 2,
numberOfOutputs: 0,
channelCount: 1,
processorOptions: {
updateIntervalInMS
}
});
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./IContent.sol";
@mwmwmw
mwmwmw / contracts...Base64.sol
Last active January 12, 2022 07:42
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @title Base64
/// @author Brecht Devos - <brecht@loopring.org>
/// @notice Provides functions for encoding/decoding base64
library Base64 {
string internal constant TABLE_ENCODE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
bytes internal constant TABLE_DECODE = hex"0000000000000000000000000000000000000000000000000000000000000000"
@mwmwmw
mwmwmw / MovementController.js
Last active November 23, 2021 20:56
A configurable ReactXR component for Joystick based navigation in VR scenes. It has configurable axes, sensitivity, deadzone and which movement types are used.
import { useXR, useController, useXRFrame } from '@react-three/xr';
import { Vector3 } from 'three';
import { useRef } from 'react';
// mapping
// 1: Trigger
// 2: Grip
// 4: Stick Buttons
@mwmwmw
mwmwmw / StrafeController.js
Created November 23, 2021 17:23
A ReactXR controller for perpendicular sideways movement
import { useXR, useController, useXRFrame } from '@react-three/xr';
import { Vector3 } from 'three';
import { useRef } from 'react';
export default function StrafeController({
hand = 'right',
sensitivity = 0.05,
zeroY = true,
@mwmwmw
mwmwmw / BasicMovementController.js
Created November 23, 2021 17:23
A ReactXR component for moving around. Forward will always move in the direction you are looking.
import { useXR, useController, useXRFrame } from '@react-three/xr';
import { Vector3 } from 'three';
import { useRef } from 'react';
export default function BasicMovementController ({
hand = 'right',
sensitivity = 0.05,
zeroY = true,