Skip to content

Instantly share code, notes, and snippets.

View evocateur's full-sized avatar

Daniel Stockman evocateur

View GitHub Profile
@evocateur
evocateur / fixconsolas
Created March 15, 2009 00:15
Fix Consolas's line-height on OS X
#!/bin/bash
#
# Requires ftxdumperfuser from http://developer.apple.com/textfonts/download/
#
# Usage: fixconsolas [files ...]
# When called with no arguments, it attempts to operate on every TrueType
# file in the current directory.
#
# References:
# http://bandes-storch.net/blog/2008/12/21/consolas-controlled/#comment-2042
@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 / 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'

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, [
grunt.initConfig({
// Runs the YUI3 build tool on a directory. Docs: <http://yui.github.io/shifter/>
"shifter": {
"crm-src": {
// (optional) version - What to fill in on the "@VERSION@" field in built files
"version": "CRM",
// (optional) lint can be 'config' or false
// if "config", shifter will use the nearest .jshintrc JSON file as JSHint config
// if "false", shifter will skip the lint step entirely.
"lint" : "config",
/*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,
@evocateur
evocateur / gist:5017874
Last active December 14, 2015 02:59 — forked from ericf/gist:5015971
A script to include or exclude YUI modules based on their node.js compatibility.
#!/usr/bin/env node
var fs = require('fs'),
path = require('path'),
yui_module = process.argv[2] ? path.join(process.cwd(), process.argv[2]) : 'yui',
output = process.argv[3],
EXCLUDE_FILTERS = [
/^cookie/,
@evocateur
evocateur / z-aliased-attr-test.html
Created November 6, 2012 18:57
Aliased Attribute Extension
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="ie ie8" lang="en"> <![endif]-->
<!--[if gte IE 9]> <html class="ie" lang="en"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>z-aliased-attr Test Suite</title>