Skip to content

Instantly share code, notes, and snippets.

@brianjmiller
brianjmiller / gist:1076600
Created July 11, 2011 19:32
make_itl_loop_struct
#
# given an array of hash refs return a structure that is designed to used
# by one of IC's looping tags via the "list" attribute
#
sub make_itl_loop_struct {
my $self = shift;
my $data = shift;
unless (defined $data) {
Vend::Exception::ArgumentMissing->throw('data arg not provided');
@brianjmiller
brianjmiller / gist:1125951
Created August 4, 2011 19:02
YUI_config fails with no filter raw
Management Area
{
"comboBase":"/combo?",
"root":"ic/vendor/yui3/build/",
"base":"/ic/vendor/yui3/build/",
"combine":true,
"insertBefore":"styleoverrides",
"groups":{
"gallery":{
@brianjmiller
brianjmiller / gist:1125964
Created August 4, 2011 19:06
YUI_config succeeds with filter raw
{
"filter":"raw",
"comboBase":"/combo?",
"root":"ic/vendor/yui3/build/",
"base":"/ic/vendor/yui3/build/",
"combine":true,
"insertBefore":"styleoverrides",
"groups":{
"gallery":{
"combine":true,
@brianjmiller
brianjmiller / gist:1189954
Created September 2, 2011 21:19
Camp installation notes
Per System:
open iptables to camp port ranges
set up Interchange::Deployment
set up camps
git clone
useradd camp
groupadd camp
createuser -PE camp
createdb camp
@brianjmiller
brianjmiller / gist:1249009
Created September 28, 2011 19:39
Additional MakeNode _templateHandlers
Y.MakeNode.prototype._templateHandlers["@@"] = function (args) {
args = this._parseMakeNodeArgs(args);
if (args.length !== 2 || args[0] === "" || args[1] === "") {
return;
}
var av = this.get(args[0]);
if (! av) {
return;
}
return av.get(args[1]);
@brianjmiller
brianjmiller / gist:1282603
Created October 12, 2011 21:14
toJSON and mlClass attribute properties
// use as follows (can be combined)
{
ATTRS: {
total: { value: 0, toJSON: false },
lines: { value: null, setter: '_setML', mlClass: Y.App.Manage.ML.Lines }
}
}
// base class definition
@brianjmiller
brianjmiller / gist:1295327
Created October 18, 2011 12:43
Failing Y.MakeNode template snippet
{? {n @ model @ id} {n @ model @ id} "<select class={c supplierSelect}><option value=>{s choose_one_option_label}</option></select>"}
@brianjmiller
brianjmiller / gist:1423598
Created December 2, 2011 15:15
get_subtree subroutine
sub get_subtree {
my ($self, %opt) = @_;
my (@load, %referents, @top_nodes, @tree, %map, $db, $nodes);
$nodes = delete $opt{work_chart_nodes};
$db = $opt{db} || $self->init_db;
%map = map {
$_->db( undef );
$_->children( [] );
@brianjmiller
brianjmiller / gist:1443182
Created December 7, 2011 15:18
Use of MakeNode
YUI.add(
"ep-w-work_entry-duration-base",
function (Y) {
var Clazz = Y.namespace("EP.W.WorkEntry.Duration").Base = Y.Base.create(
"ep-w-work_entry-duration-base",
Y.Widget,
[ Y.MakeNode, Y.IC.ModelConsumer ],
{
BOUNDING_TEMPLATE: '<tr></tr>',
CONTENT_TEMPLATE: null,
@brianjmiller
brianjmiller / gist:1540779
Created December 30, 2011 17:49
YUI: Single Template
YUI.add(
"ep-w-work_entry-base",
function (Y) {
var UI = Y.Widget.UI_SRC;
var MODE = "Mode";
var STATUS = "Status";
var WC_AC_SOURCE = "WorkChart/ac?";
var Clazz = Y.namespace("EP.W.WorkEntry").Base = Y.Base.create(