Skip to content

Instantly share code, notes, and snippets.

View bmvakili's full-sized avatar

Bijan Vakili bmvakili

View GitHub Profile
@bmvakili
bmvakili / handlebarexample.css
Created January 22, 2015 04:37
handlebar example css
section#body-section #dashboard-wrapper {
width: 97%;
display: block;
margin-left: auto;
margin-right: auto;
border: dashed black 1px;
padding: 1em;
}
@bmvakili
bmvakili / handlebarjsexamplecontent.handlebars
Created January 22, 2015 04:38
handlebar example content handle
<h1 class="page-title">{{page_title}}</h1>
<ul>
{{#each dashboard}}
{{dashboard_link}}
{{/each}}
</ul>
<div id='dashboard-wrapper'>
{{#each dashboard}}
@bmvakili
bmvakili / handlebarexample.js
Created January 22, 2015 04:40
handlebar example js
$(document).ready(function() {
var source = null;
var activeDashboardId = 0;
render = function() {
$.getJSON(
'/edens_group/test/list',
function(data) {
console.log(data);
for(datum of data) {
console.log("Num Dashboards: " + datum.numDashboards);
@bmvakili
bmvakili / handlebarexample.json
Last active August 29, 2015 14:13
handlebar example json
[
{
"errors" : "",
"numDashboards" : 3,
"dashboard" :
[ {
"id" : 0,
"name" : "costs",
"numCharts" : 1,
"chart" : [
@bmvakili
bmvakili / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@bmvakili
bmvakili / liferay kaleo variables
Created March 28, 2015 20:18
Liferay 6.2GA3 Kaleo Beanshell Variables for Task in Action element
this = 'this' reference (XThis) to Bsh object: NameSpace: global (bsh.NameSpace@2bc198b5)
this.variables = [Ljava.lang.String;@3310a984
taskComments
taskName
workflowTaskAssignees
serviceContext
entryType
groupId
userId
entryClassPK
@bmvakili
bmvakili / listall.ftl
Last active January 3, 2016 16:18
dump all freemarker vairables
<br />
.main: <br />
<#list .main?keys as var>
<br/>Key : <strong>${var} </strong>
<br/>Val :
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<#if .main[var]?is_sequence>
<#list .main[var] as varkey>
<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${varkey}
</#list>
@bmvakili
bmvakili / convert.sh
Created May 14, 2015 20:08
Problem import dump from Win to linux
#!/bin/bash
# Problem import dump from Win to linux
# Win mysql tables lowercase; and case insensitive as the default
# LInux mysql tables have case; and are case sensitive as the default
# So dumping from Win to Linux breaks things
# This script needs reference schema with case; it will use that to convert the dump file
# I have tested this with Liferay 6.2; ubuntu version 14.04
# This file is based on answer by l0co on StackOverflow
@bmvakili
bmvakili / getallliferayportalbeans.bsh
Created June 14, 2015 14:37
get all liferay Portal beans
import com.liferay.portal.bean.BeanLocatorImpl;
import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
String[] vals = PortalBeanLocatorUtil.getBeanLocator().getNames();
for (String val : vals) {
out.println( val );
@bmvakili
bmvakili / GitCodeReviewUtility.java
Last active August 29, 2015 14:26
A utility for some code reviews
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.security.AllPermission;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;