Skip to content

Instantly share code, notes, and snippets.

@createvibe
createvibe / ProxyObserver.js
Last active December 11, 2020 07:35
Deep Observable Proxy - Maintains the observed object path for complex data types, so developers can know which root properties have been modified.
/**
* The ProxyObserver recursively wraps complex objects for observations
* @param {{}|[]} target The target you want to observer
* @param {function} observer
* @throws TypeError if observer is not a function
*/
function ProxyObserver(target, observer) {
if (typeof observer !== 'function') {
throw new TypeError('Expecting observer to be a callable function.');
}
@createvibe
createvibe / .gitlab-ci.yml
Last active August 3, 2020 02:15
Gitlab Jenkins Build Job
image: "docker:19.03.0-dind"
stages:
- build
variables:
JENKINS_USER: JENKINS_USER_NAME
JENKINS_TOKEN: JENKINS_USER_ACCESS_TOKEN
JENKINS_JOB_URL_DEV: JENKINS_JOB_URL
INSTANCE_IP: SOME_DEPLOY_INSTANCE
@createvibe
createvibe / Vue-dependency-injection.js
Last active June 30, 2020 22:41
Vue dependency injection
// conga libs
import di from '@conga/dependency-injection';
// set up the configuration from our .di.json files
// .di.json, .di.development.json, .di.production.json, .di.test.json
const env_config = require('./di.' + process.env.NODE_ENV + '.json');
const config = require('./di.json');
const merged_config = {
parameters: Object.assign(
config.parameters,
@createvibe
createvibe / twig.0.9.5.min.js
Created October 9, 2016 23:20
TwigJS 0.9.5 Minified
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Twig=t():e.Twig=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){/**
* Twig.js 0.8.9
*
* @copyright 2011-2016 John Roepke and the Twig.js Contributors
* @license Available under the BSD 2-Clause License
* @link https://github.com/twigjs/twig.js
*/
var n={VERSION:"0.8.9"};r(1)(n),r(2)(n),r(3)(n),r(5)(n),r(6)(n),r(7)(n),r(17)(n),r(18)(n),r(22)(n),r(23)(n),r(24)(n),r(25)(n),r(26)(n),r(27)(n),e.exports=n.exports},function(e,t){e.exports=function(e){"use strict";function t(e,t){var r=Object.prototype.toString.call(t).slice(8,-1);return void 0!==t&&null!==t&&r===e}return e.trace=!1,e.debug=!1,e.cache=!0,e.placeholders={parent:"{{|PARENT|}}"}
/**
* @constructor Creates a new memory manager for the provided array.
* @param {memory} An array to use as the backing memory.
*/
function MemoryManager(memory){
this.memory = memory;
this.allocated = {};
}
/**
Twig.extend(function(Twig) {
'use strict';
var placeholders = {};
Twig.Templates.registerLoader('async', async_loader);
// overloaded to handle logic output promises
Twig.parse = function (tokens, context) {