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 / toolkit
Created August 9, 2014 00:42
toolkit
find . -regextype awk -regex "./*(.*controller\.xml|.*services.*\.xml|.*Screens\.xml|.*Forms\.xml|.*Services\.xml|.*Services\.java|.*\.ftl|.*\.js)" -exec grep -inrIH --color 'class="screenlet"' {} \;
find . -regextype awk -regex "./.*Screens\.xml" -exec grep -inrIH --color 'searchOptions' {} \;
@wmfairuz
wmfairuz / detach-folder
Created August 4, 2014 04:21
detach folder from repo
pushd <big-repo>
git subtree split -P <name-of-folder> -b <name-of-new-branch>
popd
mkdir <new-repo>
pushd <new-repo>
git init
git pull </path/to/big-repo> <name-of-new-branch>
@wmfairuz
wmfairuz / directives
Created July 9, 2014 07:58
built-in directive
ng-app
ng-model="foo"
ng-init="names=['A', 'B']"
@wmfairuz
wmfairuz / cordova-basics
Created June 29, 2014 02:49
cordova basics
# install cordova
npm install -g cordova
# ripple
npm install -g ripple-emulator
ripple emulate --path platforms/android/assets/www
@wmfairuz
wmfairuz / grunt-bower-yo-recipes
Created June 29, 2014 02:45
grunt/bower/yo recipes
# install package
bower install d3 -S
# update html with bower component
grunt bowerInstall
# yeoman .gitignore
node_modules/
bower_components/
*.log
@wmfairuz
wmfairuz / debian-nodejs.sh
Created June 10, 2014 07:11
debian-nodejs.sh
sudo apt-get install python g++ make checkinstall fakeroot
src=$(mktemp -d) && cd $src
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd node-v*
./configure
sudo fakeroot checkinstall -y --install=no --pkgversion $(echo $(pwd) | sed -n -re's/.+node-v(.+)$/\1/p') make -j$(($(nproc)+1)) install
sudo dpkg -i node_*
@wmfairuz
wmfairuz / astro-template
Created June 6, 2014 09:33
astro template
[code_highlight]console.log('Hello World!');[/code_highlight]
[columns][columns_left]<h4>Left Side</h4>Lorem ipsum dolor sit amet, consectetur adipisicing elit.[/columns_left][columns_right]<h4>Right Side</h4>Lorem ipsum dolor sit amet, consectetur adipisicing elit.[/columns_right][/columns]
[annotated header="Annotation Header" annotation="Annotation description text."]This is my content I want annotated.[/annotated]
[youtube]ZwzY1o_hB5Y[/youtube]
[vimeo]35396305[/vimeo]
@wmfairuz
wmfairuz / install-neo4j
Created June 6, 2014 08:54
install-neo4j
# start root shell
sudo -s
# Import our signing key
wget -O - http://debian.neo4j.org/neotechnology.gpg.key | apt-key add -
# Create an Apt sources.list file
echo 'deb http://debian.neo4j.org/repo stable/' > /etc/apt/sources.list.d/neo4j.list
# Find out about the files in our repository
apt-get update
# Install Neo4j, community edition
apt-get install neo4j
@wmfairuz
wmfairuz / htmlform
Created June 3, 2014 04:41
HTML form skeleton
<c:set var="action" value="${url.base}"/>
<template:tokenizedForm>
<form action="<c:url value='${action}'/>" method="post">
<input type="hidden" name="originUrl" value="${pageContext.request.requestURL}"/>
<input type="hidden" name="jcrNodeType" value="jnt:company"/>
<input type="hidden" name="jcrRedirectTo" value="<c:url value='${url.base}${renderContext.mainResource.node.path}'/>"/>
<input type="hidden" name="jcrNewNodeOutputFormat" value="html"/>
</form>
</template:tokenizedForm>
@wmfairuz
wmfairuz / taglib
Created June 1, 2014 10:23
custom taglib
example:
A Java file: src/main/java/org/jahia/modules/survey/taglib/FormFunctions.java
Declare taglib in TLD: src/main/resources/META-INF/jahia-survey.tld
<description>Jahia Survey module tag library</description>
<display-name>Jahia Survey Service</display-name>
<tlib-version>1.0-SNAPSHOT</tlib-version>
<short-name>survey</short-name>
<uri>http://www.jahia.org/tags/survey</uri>