Skip to content

Instantly share code, notes, and snippets.

View evocateur's full-sized avatar

Daniel Stockman evocateur

View GitHub Profile
@evocateur
evocateur / setup-leaf-references.js
Created November 11, 2019 01:15
Setup relative tsconfig references in Lerna monorepo leaf nodes
#!/usr/bin/env node
'use strict';
const path = require('path');
const fs = require('fs-extra');
const { getPackages } = require('@lerna/project');
const PackageGraph = require('@lerna/package-graph');
(async () => {
@evocateur
evocateur / dist-tag.js
Last active April 15, 2019 14:46
libnpmdisttag
"use strict";
/* eslint
import/no-extraneous-dependencies: off,
node/no-extraneous-require: off,
*/
const npa = require("npm-package-arg");
const fetch = require("npm-registry-fetch");
const RegistryConfig = require("npm-registry-fetch/config");
@evocateur
evocateur / 01_indexedListReducerGenerator.js
Created August 16, 2016 03:02 — forked from elado/01_indexedListReducerGenerator.js
Redux Indexed List Reducer Generator
import shallowequal from 'shallowequal'
import _ from 'lodash'
export const LIST_UPSERT = '@@list/LIST_UPSERT'
export const LIST_DELETE = '@@list/LIST_DELETE'
const ids = (state=[], action) => {
switch (action.type) {
case LIST_UPSERT: {
const hasAt = typeof action.at !== 'undefined'
@evocateur
evocateur / gte-version.js
Created August 6, 2014 18:25
Git Tag Extended Version
#!/usr/bin/env node
/**
Git Tag Extended Version
A method to derive Maven/Nexus-compatible versions from git tags.
npm i bluebird
./gte-version.js
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@evocateur
evocateur / promise-each.js
Last active August 29, 2015 14:02
Y.Promise.each
YUI.add('promise-each', function (Y) {
function isArray(obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
}
function isFunction(obj) {
return obj && (typeof obj === 'function');
}
@evocateur
evocateur / mvncolor.sh
Last active August 29, 2015 14:00 — forked from dant3/mvncolor.sh
Add color to Maven output
#!/usr/bin/env bash
# Formatting constants
BOLD=`tput bold`
UNDERLINE_ON=`tput smul`
UNDERLINE_OFF=`tput rmul`
TEXT_BLACK=`tput setaf 0`
TEXT_RED=`tput setaf 1`
TEXT_GREEN=`tput setaf 2`
TEXT_YELLOW=`tput setaf 3`
@evocateur
evocateur / README.md
Created March 6, 2014 19:44 — forked from caridy/README.md
YUI Locator

What is this?

This is a script that you can add to your application to generating yui meta data and compiling yui modules using express-yui and locator. As a result, a build folder will be generated with everything that was compiled.

How does this work?

Locator walks the folder structure for your app, and finds any yui module, including build.json or just traditional *.js files with the corresponding YUI.add() statement. Generating the result of the operation as well as the metadata associated to each module.

Under the hood, it uses shifter to generate almost everything that is needed.

Parent/Child Y.Views

As I worked with Y.App it became clear that while Y.View is a great abstraction it would be easy to overwhelm a single instance with way too much functionality. This is my attempt to solve that issue by allowing multiple child views to be attached to a single parent view via an extension.

Usage

The extension is mixed into the parent view like any other extension using Y.Base.create.

var Parent = Y.Base.create("view", Y.View, [
/*jslint node:true, forin:true */
module.exports = function (grunt) {
var path = require('path'),
isArray = Array.isArray,
template = 'ddc.utils.namespace("ddc.crm.modules.crm", <%= JSON.stringify(modules) %>);';
grunt.registerMultiTask('build-config', 'Build the YUI config files', function () {
var data = this.data,
envs = data.envs,