Skip to content

Instantly share code, notes, and snippets.

View wmfairuz's full-sized avatar

Fairuz Wan Ismail wmfairuz

  • TrizIT Lab Sdn Bhd
  • Malaysia
View GitHub Profile
@wmfairuz
wmfairuz / view-skeleton.jsp
Created May 26, 2014 07:16
view skeleton
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="template" uri="http://www.jahia.org/tags/templateLib" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="jcr" uri="http://www.jahia.org/tags/jcr" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--@elvariable id="currentNode" type="org.jahia.services.content.JCRNodeWrapper"--%>
<%--@elvariable id="out" type="java.io.PrintWriter"--%>
@wmfairuz
wmfairuz / context
Created May 23, 2014 04:02
context
${currentNode.nodes}
${currentNode.identifier}
${currentNode.name}
${currentNode.path}
${currentNode.url}
${renderContext.site}
${renderContext.mainResource}
${renderContext.loggedIn}
${renderContext.liveMode}
@wmfairuz
wmfairuz / mixins
Created May 23, 2014 03:56
mixins
Specific mixins:
mix:title
jmix:editorialContent - full contribute mode
jmix:droppableContent - allow to be drag drop
jmix:list
jmix:cache - add option to override cache
@wmfairuz
wmfairuz / properties
Created May 23, 2014 03:49
properties
currentNode is always available.
1. Access using EL expression
${currentNode.properties.propertyName.format}
OR
${currentNode.properties['propertyname'].format}
It's possible to define specific views to fit different output formats.
val a:Int = 0 // immutable
var b:Int = 0 // mutable
def foo(a: Int): Int = ??? // function definition
// anonymous function. (x: Int) is parameter. x * x is body
(x: Int) => x * x
// above can be rewriten with (with a name f)
def f(x:Int): Int = x * x
// function that accept another function in argument
def f(g: Int => Int, a: Int): Int = f(a) + a
@wmfairuz
wmfairuz / neo4j-cypher-node-crud
Created May 5, 2014 06:34
neo4j-cypher-node-crud
** CREATE **
// empty node
CREATE (n) RETURN n
// node with properties
CREATE (n {name : 'Fairuz'}) RETURN n
// add relationship
START a=node(1), b=node(2)
CREATE a-[r:FRIEND_OF]->b
@wmfairuz
wmfairuz / wsdl-stubs.sh
Created April 29, 2014 06:49
wsdl stubs
wsimport -keep http://192.168.56.101:8080/networkinventory/KuwaibaService?wsdl
find . -name '*.class' -exec rm {} \;
@wmfairuz
wmfairuz / jolokia-classes
Created April 21, 2014 08:37
jolokia classes
J4pExecRequest
J4pListRequest
J4pReadRequest
J4pSearchRequest
J4pVersionRequest
J4pWriteRequest
@wmfairuz
wmfairuz / oracle7-debian.sh
Last active August 29, 2015 14:00
Install Oracle 7 on Debian
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get install oracle-java7-installer