Skip to content

Instantly share code, notes, and snippets.

View evocateur's full-sized avatar

Daniel Stockman evocateur

View GitHub Profile
@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 / 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,
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",
@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/,
YUI.add('node-scroll-info', function (Y) {
/**
Provides the ScrollInfo Node plugin, which exposes convenient events and methods
related to scrolling.
@module node-scroll-info
**/
/**