Skip to content

Instantly share code, notes, and snippets.

View DevEarley's full-sized avatar
🎯
Focusing

Alex Earley DevEarley

🎯
Focusing
View GitHub Profile
@DevEarley
DevEarley / SlowTimeOnClick
Created November 14, 2014 22:00
SlowTimeOnClick
using UnityEngine;
using System.Collections;
public class SlowTimeOnClick : MonoBehaviour {
void Update() {
if (Input.GetButtonDown("Fire1")) {
if (Time.timeScale == 1.0F)
Time.timeScale = 0.7F;
else
Time.timeScale = 1.0F;
@DevEarley
DevEarley / spectrum
Created November 14, 2014 22:03
Spectrum - sync colors to a beat
using UnityEngine;
using System.Collections;
public class Spectrum : MonoBehaviour {
public AudioSource song;
public GameObject cube;
float[] historyBuffer = new float[43];
// Use this for initialization
@DevEarley
DevEarley / CameraTricks
Created January 23, 2015 19:00
Camera Tricks
http://wiki.unity3d.com/index.php/CameraGradientBackground
http://wiki.unity3d.com/index.php/ScreenWipes
http://wiki.unity3d.com/index.php/SmoothLookFrame
http://wiki.unity3d.com/index.php/SmoothMouseLook
# First, ignore everything
*
# Now, whitelist anything that's a directory
!*/
# And all the file types you're interested in.
!angular.min.js
!angular-animate.min.js
!angular-aria.min.js
!angular-material.min.js
!angular-touch.min.js
@DevEarley
DevEarley / bash w node toolbox
Last active June 3, 2017 02:16
a bunch of helpful bash commands
// see what you have installed globally
npm ls -g --depth 0
//quickly scss compile files
$ node-sass site.scss site.css
//or
$ node-sass /dir /out
@DevEarley
DevEarley / gist:f27553db96ad6794bfe71ef9c12b722c
Last active June 3, 2017 02:05
aurelia cli w electron-packager
INSTALL
electron-reload
electron-packager
aurelia-cli
FROM https://github.com/MeirionHughes/aurelia-cli-electron-app
=======================================================================
git clone <...>
.animate {
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
}
.animate-opacity {
-webkit-transition: opacity 0.1s ease-out;
-moz-transition: opacity 0.1s ease-out;
transition: opacity 0.1s ease-out;
@DevEarley
DevEarley / affix-w-debounce.js
Last active October 3, 2018 14:51
Angular Directive watches page scroll w/ debounce feature
'use strict';
angular.module('someApp').directive('simpleAffix', ['$window',function ($window) {
return {
scope: {
onAffix: "&",
onUnaffix: "&",
affixHeight:"="
},
restrict: 'A',
link: function (scope, element, attrs)
@DevEarley
DevEarley / bindHTML
Created June 14, 2017 20:58
Angular Directive - easily bind a string of HTML.
'use strict';
angular.module('someApp').directive('bindHtml', ['$window', function () {
return function(scope, element, attr) {
element.addClass('ng-binding').data('$binding', attr.bindHtml);
scope.$watch(attr.bindHtml, function bindHtmlWatchHandler(value) {
element.html(value || '');
});
}
}]);
@DevEarley
DevEarley / json-data-service.js
Last active October 3, 2018 15:19
It's a JsonDataService
angular.module('someApp')
.service('JsonDataService', function () {
return {
init: function () {
var thisService = this;
var xobj = new XMLHttpRequest();
xobj.overrideMimeType("application/json");
xobj.open('GET', './app/data/cm-ux-guide-data.json', true);
xobj.onreadystatechange = function () {