Skip to content

Instantly share code, notes, and snippets.

View huffman's full-sized avatar

Ryan Huffman huffman

View GitHub Profile
var i = 0;
var testProps = {};
var self = null;
(function() {
return {
preload: function(entityID) {
self = this;
print("Preload 2: ", entityID);
this.entityID = entityID;
this.intervalID = Script.setInterval(this.update, 1000);
https://rawgit.com/huffman/hifi/05ca63f824db4f575c04ee019b987d0e23633637/unpublishedScripts/DomainContent/Toybox/towerDefense/playWaveGame.js
@huffman
huffman / acSimTest.js
Created February 3, 2016 17:36
AC Simulation Test
var entities= [];
var WALL_THICKNESS = 0.2;
var BOX_WIDTH = 10;
var BOX_HEIGHT = 10;
var BOX_DEPTH = 10;
basePosition = { x: 0, y: 0, z: 0 };
// Floor
var url = "http://hifi-content.s3.amazonaws.com/DomainContent/Junkyard/Sounds/streetparty3.L.wav";
var sound = SoundCache.getSound(url);
var id = Script.setInterval(function() {
print("Checking audio...");
if (sound.downloaded) {
Script.clearInterval(id);
print("Starting audio...");
Audio.playSound(sound, {
position: { x: 0, y: 0, z: 0 },
Controller.keyPressEvent.connect(function(ev) {
print("In keyPressEvent 1");
throw("Exception in keyPressEvent 1");
});
Controller.keyPressEvent.connect(function(ev) {
print("In keyPressEvent 2");
throw("Exception in keyPressEvent 2");
});
<input type="color"></input>
@huffman
huffman / letThereBeLight.js
Created February 27, 2015 23:46
letThereBeLight.js
//
// SunLightExample.js
// examples
// Sam Gateau
// Copyright 2015 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
@huffman
huffman / eval.js
Last active August 29, 2015 14:14
Self evaluating entity script
(function(){
print("Loading self evaluating entity script");
this.preload = function(entityID) {
var properties = Entities.getEntityProperties(this.entityID);
eval(properties.userData);
}
});
@huffman
huffman / gist:8fc4f10c4c80d5982034
Created January 9, 2015 00:48
VS 2013 interface libraries
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
comdlg32.lib
advapi32.lib
@huffman
huffman / a.py
Created September 20, 2012 03:39
GCJ 2008 Qualification
#!/usr/bin/env python
from sys import stdin
from sets import Set
for case in xrange(int(stdin.readline())):
num_engines = int(stdin.readline())
engines = []
for _ in xrange(num_engines):
engines.append(stdin.readline())