Skip to content

Instantly share code, notes, and snippets.

# Install iproute (Ubuntu)
sudo apt-get install iproute
# Increase network latency in eth0 (250 milliseconds)
sudo tc qdisc add dev eth0 root netem delay 250ms
# Delete network modifications
sudo tc qdisc del dev eth0 root netem
# To make this change in localhost you must only replace "eth0" to "lo" ( --- WARNING --- in this case time will double )
@nickyvanurk
nickyvanurk / camera.tsx
Last active July 28, 2023 17:35
Camera perspective <-> orthographic toggle in r3f and vanilla three.js
import { useEffect, useRef, useState } from 'react';
import { useFrame, useThree } from '@react-three/fiber';
import { MapControls, OrthographicCamera, PerspectiveCamera } from '@react-three/drei';
import type { OrbitControls as OrbitControlsImpl } from 'three-stdlib';
export function Camera() {
const [oldType, setOldType] = useState('PerspectiveCamera');
const [coords, setCoords] = useState({ x: 0, y: 0 });
const gl = useThree((state) => state.gl);
@nickyvanurk
nickyvanurk / ThreeViewer.ts
Last active May 30, 2023 11:09
Threejs-react-starter-template (Vanilla)
import {
BoxGeometry,
Color,
HemisphereLight,
Mesh,
MeshBasicMaterial,
MeshNormalMaterial,
PerspectiveCamera,
PlaneGeometry,
Scene,