Skip to content

Instantly share code, notes, and snippets.

@foopis23
foopis23 / vrapp.js
Created June 10, 2021 15:23
Simple Multiplayer with THREE JS & Firebase
// Option 1: Import the entire three.js core library.
import * as THREE from 'three';
import { BoxBufferGeometry, Mesh, MeshPhongMaterial } from 'three';
import { BoxLineGeometry } from 'three/examples/jsm/geometries/BoxLineGeometry.js';
import { VRButton } from 'three/examples/jsm/webxr/VRButton.js';
import { XRControllerModelFactory } from 'three/examples/jsm/webxr/XRControllerModelFactory.js';
let DB;
@AniketSK
AniketSK / firestore.rules
Created October 25, 2019 05:21
Some sample firebase rules.
rules_version = '2';
function isAuthenticated(request){
return request.auth != null && request.auth.uid != null
}
function isDocUidSameAsUserUid(request){
return request.auth.uid == request.resource.data.uid
}
@HarryStevens
HarryStevens / .block
Last active February 21, 2023 14:42
Camera Tween
license: gpl-3.0
@puf
puf / README.md
Last active March 28, 2023 16:37
Firebase Hosting Deploy Single File

This script may no longer work. Have a look at its (more official) replacement: https://github.com/firebase/firebase-tools/tree/master/scripts/examples/hosting/update-single-file

Firebase Hosting Deploy Single File

This utility script deploy a single local file to an existing Firebase Hosting site. Other files that are already deployed are left unmodified.

The difference with firebase deploy is that this script does not require you to have a local snapshot of all hosted files, you just need the one file that you want to add/update.

@iaverin
iaverin / rest35.py
Last active September 5, 2023 19:58
Simple and functional REST server for Python (3.5) using no dependencies beyond the Python standard library. Ported from https://gist.github.com/tliron/8e9757180506f25e46d9
#!/usr/bin/env python
'''
Simple and functional REST server for Python (3.5) using no dependencies beyond the Python standard library.
Ported from original lib for Python 2.7 by Liron (tliron @ github.com) https://gist.github.com/tliron/8e9757180506f25e46d9
Features:
* Map URI patterns using regular expressions
* Map any/all the HTTP VERBS (GET, PUT, DELETE, POST)
* All responses and payloads are converted to/from JSON for you
* Easily serve static files: a URI can be mapped to a file, in which case just GET is supported
@codeBelt
codeBelt / docs.md
Last active October 13, 2023 13:13
Firestore rules function examples
@cdata
cdata / three-clone-gltf.js
Created November 8, 2017 23:26
A quick hack to clone a Three.js GLTF scene without re-loading or re-parsing the source.
const cloneGltf = (gltf) => {
const clone = {
animations: gltf.animations,
scene: gltf.scene.clone(true)
};
const skinnedMeshes = {};
gltf.scene.traverse(node => {
if (node.isSkinnedMesh) {
@vasturiano
vasturiano / README.md
Last active September 18, 2019 01:21
VR Hyperspace

Simulation of random distribution of objects in 3D space after a (big) bang. Rendered in VR using 3d-force-graph-vr. Move around using arrow/wasd keys or a gamepad.

@ngokevin
ngokevin / gist:803e68351f70139da51fda48d3b484e3
Created October 25, 2017 07:51
Example of keyboard bindings for A-Frame/VR development.
/**
* Keyboard bindings to control controller and create actions via events.
* Position controllers in front of camera.
* <a-scene debug-controller> ?debug in URL to toggle on.
*/
AFRAME.registerComponent('debug-controller', {
schema: {
enabled: {default: false}
},