Skip to content

Instantly share code, notes, and snippets.

background (Scene)

 color

fog (Scene)

 type, color, near, far, density
@humbletim
humbletim / common.js
Last active July 15, 2019 00:59
CustomAPIExample test scripts
// multicontext test script
var script = typeof Script === 'object' ? Script : { type: typeof window === 'object' ? 'browser' : 'unknown' };
var api = typeof KasenAPIExample === 'object' ? KasenAPIExample : {};
var details = {
type: script.type + '',
api: api + '',
now: api.now && api.now() + '',
};
@humbletim
humbletim / basecrm_create_lead.php
Created August 24, 2017 13:58 — forked from iaintshine/basecrm_create_lead.php
Create a new lead using php 5.3 and Base API v2
<?php
function createLead($accessToken, array $lead)
{
$method = 'post';
$absUrl = 'https://api.getbase.com/v2/leads';
$headers = array(
'User-Agent: BaseCRM/PHP Sample',
'Authorization: Bearer ' . $accessToken,
'Accept: application/json',

Keybase proof

I hereby claim:

  • I am humbletim on github.
  • I am htio (https://keybase.io/htio) on keybase.
  • I have a public key ASAavTyTo5Al-oomVMaBaSnjLSLM0lIQ22LyD-sHkC_17go

To claim this, I am signing this object:

@humbletim
humbletim / test-parented-overlay-children.js
Last active June 24, 2017 00:10
Test Entity / Overlay models with parented children
// test Client script to compare Model Overlay vs. Model Entity behavior for attached child Overlays
// humbletim @ 2017.06.23
var overlayProps = {
url: MyAvatar.skeletonModelURL,
position: Vec3.sum(Quat.getForward(MyAvatar.orientation), MyAvatar.position),
scale: 1,
};
var ids = {
overlays: [
(function(){
var teleport;
var portalDestination;
var animationURL;
var position;
function playSound(entityID) {
print("playing teleport sound");
if (teleport.downloaded) {
if(!position) {
@humbletim
humbletim / testEntityResourceLeaks-entity.js
Last active March 15, 2017 00:02
Entity unload resource leaks
(function() {
var TROMBONE_URL = "https://s3.amazonaws.com/hifi-public/tony/audio/sad-trombone.wav";
return {
_resource: SoundCache.prefetch(TROMBONE_URL),
_sound: undefined,
_onStateChanged: function() {
var resource = this._resource;
if (resource.state === Resource.State.FINISHED) {
resource.stateChanged.disconnect(this, '_onStateChanged');
this._sound = SoundCache.getSound(TROMBONE_URL);
@humbletim
humbletim / index.html
Last active April 22, 2023 09:59
glm-js source test page
<!-- for gist purposes this BASE HREF makes everything load relative to the current live web examples -->
<!-- note: save this file in a subfolder off the the project root and remove the BASE HREF to experimental locally -->
<base href='https://humbletim.github.io/glm-js/code/test/index.html' />
<!-- glm-js core scripts -->
<script src="../src/glm.common.js" type="text/javascript"></script>
<script src="../src/glm.buffers.js" type="text/javascript"></script>
<script src="../src/glm.experimental.js" type="text/javascript"></script>
<!-- specific vendor back-end (variations exist for tdl-fast and gl-matrix as well) -->
@humbletim
humbletim / car.js
Created February 7, 2017 03:42 — forked from anonymous/car.js
Node circular dependencies example
var gas = require('./gas');
var speed = 0;
exports.drive = function () {
gas.burn();
};
exports.accelerate = function () {
speed += 10;
@humbletim
humbletim / require-module-exports.md
Created December 12, 2016 06:21
Reasons to prefer `require / module.exports` in context
  • Keeps it "simple" for scripters to bring modules in.

    • "require is just an ordinary function that takes a string and returns useful stuff..."
  • Follows the "de facto" JS module standard.

    • Mainstream JS modules already support this pattern as part of the "module systems magic dance."
  • Offers a backwards-compatible, transitional way to migrate existing Script.include modules.

  • Can start with truly featherweight implementations.

    • A minimalist var api = require(url); polyfill can be realized in half-a-dozen lines of local JS code.