This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[module/herbstluftwm] | |
type = custom/script | |
exec-if = ps -C herbstluftwm >/dev/null 2>&1 | |
exec = MONITOR=HDMI-0 ~/.config/polybar/herbstluftwm.sh | |
tail = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* How to use this script : | |
To play with it "as is" try it in the console of your browser first. | |
If you do like and want to make it permanent then a bit of UI integration is needed | |
(e.g. could add an icon, chat command, etc). | |
That would be done by using https://hubs.mozilla.com/docs/hubs-cloud-custom-clients.html | |
So that your integration remains easy to merge and maintainable over time it is recommended to | |
touch Hubs Cloud code itself as little as possible. For example having separate components for |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// change YOURID with... YOUR ngrok id ;) | |
var lastModelTimestamp = null | |
var intervalCheck = setInterval(newModelReady, 500) | |
function newModelReady(){ | |
fetch('http://YOURID.ngrok.io/timestamp.txt').then( response => { return response.json() } ) | |
.then( timestamp => checkIfNovelModelAvailable(timestamp) ) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// see the alternative that fetch directly from the room to clone | |
// https://gist.github.com/Utopiah/8eb0d83e467d13994fd69c4631130561 | |
function getObjects(){ | |
var myObjects = [] | |
for (var media of document.querySelectorAll("[media-loader]")){ | |
if (media.components.pinnable && media.components.pinnable.attrValue.pinned) | |
myObjects.push({ | |
src:media.components['media-loader'].attrValue.src, | |
position: media.getAttribute('position'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var yourSceneURL = 'https://hubs.mozilla.com/LHzDxae/' // no trailing room name, only ID. | |
// Also works on Hubs Cloud servers but assets have to remain available (i.e no CORS, 404, etc) | |
// example of grabbing a local copy of assets hosted with the proxy | |
// curl https://hubs.mozilla.com/LHzDxae/objects.gltf | jq .nodes[].extensions.HUBS_components.media.src -r | grep uploads-prod.reticulum.io | |
function populateSceneFromMozGLTF(scene){ | |
document.querySelector('*[networked-counter]').setAttribute('networked-counter', {max: 100}) | |
for (var node of scene.nodes){ | |
console.log(node) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global AFRAME */ | |
const COLLISION_LAYERS = require("../constants").COLLISION_LAYERS; | |
AFRAME.registerComponent("floaty-object", { | |
schema: { | |
// Make the object locked/kinematic upon load | |
autoLockOnLoad: { default: false }, | |
// Make the object kinematic immediately upon release | |
autoLockOnRelease: { default: false }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const app = express(); | |
const fs = require('fs'); | |
const fetch = require('node-fetch'); | |
const tokenFile = './.ret.credentials' | |
const token = JSON.parse(fs.readFileSync(tokenFile, 'utf8')).token; | |
const accountURL = 'https://myhubsURL.com/api/v1/accounts' | |
app.use(express.json()) |