Skip to content

Instantly share code, notes, and snippets.

View blairmacintyre's full-sized avatar

Blair MacIntyre blairmacintyre

View GitHub Profile

This document explains my environment and workflow for handling upgrades to AEL's Hubs Cloud instance.

Overview

hubs.aelatgt.net includes source modifications to support script injection and a handful of project-specific tweaks. This allows developers to add new behaviors on a room-by-room basis without having to rebuild the client. Some projects require access to internal client logic, which we expose on a global APP.utils object.

Environment

I have multiple Git remotes configured so I can maneuver between the Mozilla and AEL repos:

function inject_createInteractiveBall() {
//Query assets in order to setup template
let assets = document.querySelector("a-assets");
// create a new template variable
let newTemplate = document.createElement("template");
// create template id
newTemplate.id = "interactable-ball-media";
// create a new entity for the template so we can append it to the assets later
@blairmacintyre
blairmacintyre / upload.sh
Last active February 20, 2020 19:01
Take an appropriate json file and upload it to the hubs-cloud account
#!/bin/sh
# the HUBS_ADMIN_ACCOUNT_TOKEN can be found by logging into the admin account in your hubs-cloud instance,
# and then looking in your browser console, executing this:
# JSON.parse(localStorage.___hubs_store).credentials.token
# YOUR_HUBS_SERVER is the public domain of your hubs instance. e.g., for the one I created for IEEE VR it is hubs.ieeevr.online
#
(curl -XPOST -H "Content-Type: application/json" -H "Authorization: bearer HUBS_ADMIN_ACCOUNT_TOKEN" -d @file.json https://YOUR_HUBS_SERVER/api/v1/accounts)
@blairmacintyre
blairmacintyre / fix-list.sh
Created February 20, 2020 16:52
convert a "email, name" csv to the json file needed by hubs-cloud account upload
#!/bin/sh
awk '
BEGIN {
print "{ \"data\": ["
FS = ",[ \t]+"
first = 1
}
{
@blairmacintyre
blairmacintyre / webmention.js
Created February 21, 2019 19:57
This is a copy of https://beesbuzz.biz/static/webmention.js, which I want to keep tabs on by storing here.
/* webmention.js
Simple thing for embedding webmentions from webmention.io into a page, client-side.
(c)2018 fluffy (http://beesbuzz.biz)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@blairmacintyre
blairmacintyre / keybase.md
Last active September 5, 2018 15:55
keybase.md

Keybase proof

I hereby claim:

  • I am blairmacintyre on github.
  • I am blairmacintyre (https://keybase.io/blairmacintyre) on keybase.
  • I have a public key ASCRrR3cpomNndbLwOcxPe_jXjWPaHBiEslrEZ94Xc7tbQo

To claim this, I am signing this object:

@blairmacintyre
blairmacintyre / argonjs.cla
Created September 11, 2015 20:13
The ArgonJS CLA
## Georgia Tech Research Corporation
### Individual Contributor License Agreement ("Agreement")
Thank you for your interest in Georgia Tech Research Corporation (“GTRC”) software. In order to clarify the intellectual property license granted with Contributions from any person or entity, GTRC must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below.
This license is for your protection as a Contributor as well as the protection of GTRC and its users; it does not change your rights to use your own Contributions for any other purpose.
If you have not already done so, please complete and sign this CLA. **You may sign this CLA electronically [using this form](https://docs.google.com/forms/d/1wl5Rg7ishq6nsfbMVoif6322NOzhjdyryHvxmiCQITc/viewform?c=0&w=1&usp=mail_form_link)**, or you may print, then scan and email a pdf file of this Agreement to industry@gatech.edu. If necessary, send an original signed Agreement to Ge
@blairmacintyre
blairmacintyre / 0_reuse_code.js
Created October 19, 2013 17:45
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@blairmacintyre
blairmacintyre / print.js
Created July 10, 2013 19:45 — forked from paulharter/print.js
Modified print.js to create two openscad files, so I can dual-print
importPackage(Packages.com.sk89q.worldedit.blocks);
importPackage(Packages.com.sk89q.worldedit);
//joins up blocks in the dimension dim
function squash(blockarray, dim, sx, sy, sz, arraysize){
var i = new Array();
var dims = new Array();
for (var y = 0; y <= sy; y++){