Skip to content

Instantly share code, notes, and snippets.

View vanrez-nez's full-sized avatar

Ivan Juarez vanrez-nez

View GitHub Profile
@vanrez-nez
vanrez-nez / brunch-config.js
Created December 15, 2017 00:56
Brunch Setup
module.exports = {
paths: {
watched: ['resources']
},
files: {
javascripts: { joinTo: {
'scripts/app.js': /^resources/,
'scripts/vendor.js': /^node_modules/
} },
stylesheets: { joinTo: {
@vanrez-nez
vanrez-nez / wait-for-global.js
Last active January 3, 2018 18:19
Wait for globals to be present
// Micro utility to execute a function when all globals are present
var waitForGlobal = function(params) {
var pathExists = function( arr, obj ) {
var target = obj[ arr.shift() ];
var exists = target !== undefined;
return arr.length == 0 ? exists : exists && pathExists(arr, target);
};
var predicate = function() {
return params.globals.every(function(path) {
@vanrez-nez
vanrez-nez / ogl.d.ts
Last active October 9, 2020 15:37
Typescript for OGL
/**
* Last updated to work with version 0.60
* Library Repo: https://github.com/oframe/ogl
* Definitions extracted from https://github.com/nshen/ogl-typescript/
*
*/
declare module 'ogl/src/math/functions/ColorFunc' {
const NAMES: {
black: string;