Posts

formating liferay search container column data

<liferay-ui:search-container-column-text name="AMOUNT" buffer=" buffer " cssClass="number-align" orderableProperty="amount"> <%                    buffer .append((TransactionTypeLocalServiceUtil.getTransactionType(transaction.getCategoryId()).isCashIn())?"$"+decimalFormating.format(transaction.getAmount()):negativeDecimalFormating.format(transaction.getAmount())); %> </liferay-ui:search-container-column-text>

Disable form post while refreshing the page

Suppose you submitted the form and after successful action call you are redirected to the new page. There if you refresh the page, you are asked to submit the form again. In that case, to disable this use the following configuration. Add this line after <icon> tag in liferay-portal.xml <action-url-redirect>true</action-url-redirect>

Play VCD in VLC Player in Ubuntu

Type this command to play vcd in vlc palyer in ubuntu. vlc vcd:///dev/sr0

Disable browser back button using javascript

<script type="text/javascript">         function noBack() {      window.location.href += "#";      setTimeout("changeHashAgain()", "50");     }     function changeHashAgain() {       window.location.href += "1";     }         var storedHash = window.location.hash;     window.setInterval(function () {         if (window.location.hash != storedHash) {              window.location.hash = storedHash;         }     }, 50); </script> <body onLoad="noBack()"> </body>

Show GIT branch on CLI

Add the following code in  ~/.bashrc alias ls='ls --color=auto' PS1="\[\e[1;32m\][\u@\h \W]\$(parse_git_branch)\[\e[0m\] " function parse_git_branch () {        git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } Type the following command to see the GIT branch name. source ~/.bashrc

Parse Bill n Pay Customer Info Json Response

 //{}&&{"biller":{"customerinfo":{"customer":[{"firstname":"S","middlename":"R","lastname":"S","internalid":"502CD927-651E-E67C-A3FD-AABEC48F026B","id":"502CD927-651E-E67C-A3FD-AABEC48F026B"}]}}}                 JSONParser parser = new JSONParser();                 //cut out first 4 characters {}&&         jsonString = jsonString.substring(4);                         Object obj = parser.parse(jsonString);         JSONObject jsonObject = (JSONObject) obj;         JSONObject biller = (JSONObject) jsonObject.get("biller");         JSONObject customerinfo = (JSONObject) bi...

Curiosity Cam

Live streaming by Ustream