Skip to content

Instantly share code, notes, and snippets.

View mattlockyer's full-sized avatar
💭
🥳

Matt Lockyer mattlockyer

💭
🥳
View GitHub Profile
var el = this.el;
el.style.display = 'none';
el.offsetHeight;
el.style.display = 'block';
@mattlockyer
mattlockyer / threejs-blendmodes
Last active November 25, 2020 00:20
Three.js blend modes from source (not in docs)
THREE.NoBlending = 0;
THREE.NormalBlending = 1;
THREE.AdditiveBlending = 2;
THREE.SubtractiveBlending = 3;
THREE.MultiplyBlending = 4;
THREE.CustomBlending = 5;
How to change it:
var material = new THREE.BasicMaterial({
@mattlockyer
mattlockyer / angular-apply-helper.js
Created February 25, 2014 20:51
Angular Apply Helper for Controllers
/*
This gist is intended to be included in controllers and provides an easy way to ensure data is applied
The function: func will be executed within an existing digest $$phase or call $scope.$apply and invoke one
*/
var apply = function(func, callback) {
if(!$scope.$$phase) {
$scope.$apply(function() {
func();
if (callback) callback();