Skip to content

Instantly share code, notes, and snippets.

@eduardolundgren
eduardolundgren / gist:1142274
Created August 12, 2011 15:21
JSONML parsed
{
"results": [{
"scriptedAssignments": [],
"resourceActionAssignments": [],
"userAssignments": [{
"emailAddress": null,
"screenName": null,
"userId": "32424234"
}],
"roleAssignments": [],
@eduardolundgren
eduardolundgren / gist:1148207
Created August 16, 2011 00:34
Kaleo definition JSONML Array
{
"workflow-definition": {
"-xmlns": "urn:liferay.com:liferay-workflow_6.1.0",
"-xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"-xsi:schemaLocation": "urn:liferay.com:liferay-workflow_6.1.0 http://www.liferay.com/dtd/liferay-workflow-definition_6_1_0.xsd",
"name": "Category Specific Approval",
"description": "A single approver can approve a workflow content.",
"version": "1",
"state": [
{
@eduardolundgren
eduardolundgren / gist:1178545
Created August 29, 2011 14:49
liferay-portlet.xml
<?xml version="1.0"?>
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 6.1.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_6_1_0.dtd">
<liferay-portlet-app>
<portlet>
<portlet-name>1</portlet-name>
<instanceable>false</instanceable>
<footer-portlet-css>/css/main.css</footer-portlet-css>
<footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
<css-class-wrapper>kaleo-designer-portlet</css-class-wrapper>
<%--
/**
* Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
@eduardolundgren
eduardolundgren / gist:1230743
Created September 20, 2011 23:39
YUI 3.4.0 DataTable header width issues when scroll and sort are plugged.
YUI().use('datatable', function(Y) {
var cols = ["name","address","city", "state", "amount", "active", "colors", { key: "fruit", sortable: true }, { key: "last_login", sortable: true } ];
var data = [
{name:"John A. Smith", address:"1236 Some Street", city:"San Francisco", state:"CA", amount:5, active:"yes", colors:["red"], fruit:["banana","cherry"], last_login:"4/19/2007"},
{name:"Joan B. Jones", address:"3271 Another Ave", city:"New York", state:"NY", amount:3, active:"no", colors:["red","blue"], fruit:["apple"], last_login:"2/15/2006"},
{name:"Bob C. Uncle", address:"9996 Random Road", city:"Los Angeles", state:"CA", amount:0, active:"maybe", colors:["green"], fruit:["cherry"], last_login:"1/23/2004"}
];
<form action="" name="fm2">
<fieldset id="simpleForm">
<p>
<label class="aui-field-label" for="name.dot">Email:</label>
<input type="text" name="name.dot" id="name.dot" />
</p>
<p>
<input class="aui-button-input" type="submit" value="Submit" />
@eduardolundgren
eduardolundgren / view.jsp
Created October 3, 2011 17:34
/html/portlet/breadcrumb/view.jsp
<%--
/**
* Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
I = imread('../assets/mixtexts1.bmp');
% S = qtdecomp(I, .27);
% blocks = repmat(uint8(0),size(S));
% for dim = [512 256 128 64 32 16 8 4 2 1];
% numblocks = length(find(S==dim));
% if (numblocks > 0)
% values = repmat(uint8(1), [dim dim numblocks]);
function [imgOut] = convertToDichromatImage(img, method)
setDefaultValue(2, 'method', 'deutran');
RGB_LMS = [ 17.8824 43.5161 4.11935;...
3.45565 27.1554 3.86714;...
0.0299566 0.184309 1.46709 ];
RGB_LMS_INV = inv(RGB_LMS);
LMS_DEUTRAN = [ 1 0 0;...