Skip to content

Instantly share code, notes, and snippets.

View brianpeiris's full-sized avatar

Brian Peiris brianpeiris

View GitHub Profile
@brianpeiris
brianpeiris / hubs-slides.js
Created August 28, 2019 21:00
Hubs slides
(() => {
class Viewer {
constructor(slides) {
this.slides = slides;
this.currentIndex = 0;
const block = "https://poly.google.com/view/0LfGexYbqij";
const root = spawnMedia(AFRAME.scenes[0], { resize: false, src: block });
const title = spawnMedia(root, { resolve: false });
import * as glm from "gl-matrix";
import * as lumin from "lumin";
import { EntityManager } from "tiny-ecs";
import * as configDefaults from "./config.defaults";
import * as configOverrides from "./config";
const config = Object.assign({}, configDefaults, configOverrides);
export class App extends lumin.LandscapeApp {
onAppStart() {
@brianpeiris
brianpeiris / aframe-perf-helpers.js
Created May 7, 2019 09:17
a-frame performance debug helpers
let calls = { qsa: 0 };
const origNodeSetAttribute = AFRAME.ANode.prototype.setAttribute;
AFRAME.ANode.prototype.setAttribute = function() {
const name = `nsa-${arguments[0]}`;
if (!calls[name]) calls[name] = 0;
calls[name]++;
if (scene.stats) scene.stats(name).set(calls[name]);
return origNodeSetAttribute.apply(this, arguments);
};
const origNodeGetAttribute = AFRAME.ANode.prototype.getAttribute;
@brianpeiris
brianpeiris / .gitignore
Last active December 3, 2018 22:41
Exokit Magic Leap fast feedback
node_modules
package-lock.json
@brianpeiris
brianpeiris / findings.md
Last active August 26, 2018 09:07
Magic Leap Helio Dev

Globals

Helio adds these globals to the Window:

  • MLAnimationEvent
    • volume property
    • model property
    • animationName property
    • type property
@brianpeiris
brianpeiris / ..robot-websocket
Last active August 4, 2018 22:19
robot-websocket
robot-websocket is a websocket server that runs robotjs commands when it receives messages.
@brianpeiris
brianpeiris / dev-speech.js
Created July 21, 2018 20:52
Speech recognition for dev tools
(() => {
const actionMap = {
space: () => console.log("---------------------------"),
dispatch: () => window.dispatchEvent(new CustomEvent("printstate"))
};
const actions = Object.keys(actionMap);
let lastActionTime = Date.now();
if (window.recognition) window.recognition.stop();
window.recognition = new webkitSpeechRecognition();
Hotkey, F8, EarlyTerm ; Quick kill command. Hit PAUSE key at any time on the keyboard to kill the script
Loop ;This is the loop. When you run this script, AHK will set the volume at desired level then wait .5 seconds then will repeat forever until you press the PAUSE key, which will kill the script.
{
SoundSet, 100, MASTER, VOLUME, 3
Sleep, 200
}
; SoundSet = AHK Command; MASTER = ComponentType; VOLUME = ControlType (This is the volume you are setting the mic at); 6 = DeviceNumber ; DeviceNumber will vary from system to system. Please run the soundcard analysis script to find out what the DeviceNumber of your microphone is. This script can be found in the AHK help here: https://autohotkey.com/docs/commands/SoundSet.htm#Ex . The soundcard analysis script is not very descriptive, so a good way to glean the information you require is to set the volume of the mic you are interested to something wierd, like 57, from within the Windows recording devices Properties interface. Then, run the soundcard analysis s
@brianpeiris
brianpeiris / subscribe-youtube.py
Created December 21, 2016 05:47
Subscribe to a list of YouTube Channels
#!/usr/bin/python
import httplib2
import os
import sys
from apiclient.discovery import build
from apiclient.errors import HttpError
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage