Skip to content

Instantly share code, notes, and snippets.

humbletim

Block or report user

Report or block humbletim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@humbletim
humbletim / common.js
Last active Jul 15, 2019
CustomAPIExample test scripts
View common.js
// 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 Aug 24, 2017 — forked from iaintshine/basecrm_create_lead.php
Create a new lead using php 5.3 and Base API v2
View basecrm_create_lead.php
<?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',
View keybase.md

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 Jun 24, 2017
Test Entity / Overlay models with parented children
View test-parented-overlay-children.js
// 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: [
View portal.js
(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 Mar 15, 2017
Entity unload resource leaks
View testEntityResourceLeaks-entity.js
(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 Mar 13, 2017
glm-js source test page
View index.html
<!-- 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 Feb 7, 2017 — forked from anonymous/car.js
Node circular dependencies example
View car.js
var gas = require('./gas');
var speed = 0;
exports.drive = function () {
gas.burn();
};
exports.accelerate = function () {
speed += 10;
@humbletim
humbletim / require-module-exports.md
Created Dec 12, 2016
Reasons to prefer `require / module.exports` in context
View require-module-exports.md
  • 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.
@humbletim
humbletim / QNetworkReply-NetworkError.cpp
Created Nov 4, 2016
QNetworkReply-NetworkError switch template
View QNetworkReply-NetworkError.cpp
// see: http://doc.qt.io/qt-5/qnetworkreply.html
switch(request->error()) {
case QNetworkReply::ConnectionRefusedError: // the remote server refused the connection (the server is not accepting requests)
case QNetworkReply::RemoteHostClosedError: // the remote server closed the connection prematurely, before the entire reply was received and processed
case QNetworkReply::HostNotFoundError: // the remote host name was not found (invalid hostname)
case QNetworkReply::TimeoutError: // the connection to the remote server timed out
case QNetworkReply::OperationCanceledError: // the operation was canceled via calls to abort() or close() before it was finished.
case QNetworkReply::SslHandshakeFailedError: // the SSL/TLS handshake failed and the encrypted channel could not be established. The sslErrors() signal should have been emitted.
case QNetworkReply::TemporaryNetworkFailureError: // the connection was broken due to disconnection from the network, however the system has initiated roaming to another
You can’t perform that action at this time.