Skip to content

Instantly share code, notes, and snippets.

@Krxtopher
Krxtopher / SmoothTargetTracking.js
Created February 16, 2019 04:22
An Amazon Sumerian script that will make the entity it is attached to orient itself smoothly so that it always faces another entity.
'use strict';
/**
* This script will make the entity it is attached to orient itself smoothly so that it always
* faces the entity assigned to the `lookAtEntity` script parameter.
*/
function setup(args, ctx) {
// The point to focus on, expressed in world space.
@Krxtopher
Krxtopher / gist:7ff983ba052de59524341e55f04a427a
Created August 17, 2017 12:22
iOS PList value for ARKit camera access
<key>NSCameraUsageDescription</key> <string>This application will use the camera for AR</string>
@Krxtopher
Krxtopher / JQuery-Implementation.js
Last active December 30, 2015 06:59
JQuery sample implementation of example scenario in this article: http://gomakethings.com/ditching-jquery-for-vanilla-js/
$(".sandwich").click(function(e) {
$(e.currentTarget).toggleClass("active");
});
@Krxtopher
Krxtopher / omit-callback-unit-test.js
Last active December 26, 2015 15:18 — forked from tobius/omit-callback-unit-test.js
Here's my simplified version of Toby's original solution. This solution takes advantage of Jasmine's built-in toThrow() matcher which is similar to matchers in the should.js, expect.js, and chai assertion libraries which all work with Mocha.
/*
The implementation below assumes you're using Jasmine's built-in matchers. But similar matchers
exist in the should.js, expect.js, and chai assertion libraries which work with Mocha.
*/
var makeSomething = function(callback) {
// Below is the simplest implementation that will result in the test passing.
// If you want a more robust implementation, you'll want to write more tests first. :)
throw(new Error("Missing parameters"));
};
@Krxtopher
Krxtopher / gist:4112499
Created November 19, 2012 18:23
Sample Gist 1
- (void)updateCarPosition
{
CGFloat sliderPercent = self.slider.value;
CGFloat carX = [QuadraticEasing easeInOutValueAtPercent:sliderPercent
from:self.carImageMinX
to:self.carImageMaxX];
self.carImage.center = CGPointMake(carX, self.carImageY);
}