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 / remove-null.java
Created April 17, 2014 08:32
Remove null elements from a Java list
myList.removeAll(Collections.singleton(null));
// select input by name
$('input[name="foo"]')
@wmfairuz
wmfairuz / cypher-relationship
Created April 16, 2014 03:17
Get outgoing/ingoing relationship for a class
START wc = node:classes(name = "WireContainer")
MATCH wc-[r]->y
RETURN type(r), y.name
@wmfairuz
wmfairuz / stash.sh
Created April 9, 2014 03:05
stash selected chunks
git stash -p
curl --compressed www.domain.com
<entity-condition list="invoiceItems" entity-name="InvoiceItem">
<condition-list combine="and">
<condition-expr field-name="invoiceId" from-field="payAppl.invoiceId" />
<condition-list combine="or">
<condition-expr field-name="productId" value="16000"
operator="equals" />
<condition-expr field-name="productId" value="54000"
operator="equals" />
<condition-expr field-name="productId" value="60000"
operator="equals" />
@wmfairuz
wmfairuz / calculation.xml
Created April 4, 2014 09:44
Do calculation in mini lang
<!-- A = B * C -->
<calculate field="A" type="BigDecimal">
<calcop field="B" operator="multiply">
<calcop field="C" operator="get"/>
</calcop>
</calculate>
<!-- A = A / 100 -->
<calculate field="A" type="BigDecimal">
<calcop field="A" operator="divide">
@wmfairuz
wmfairuz / commit-msg.sh
Created April 4, 2014 09:32
Get commit-msg hook
scp -p -P 29418 review.example.com:hooks/commit-msg .git/hooks/
Generate properties file
java -jar myinstaller.jar -options-template myinstaller.properties
Install using properties file
java -jar myinstaller.jar -options myinstaller.properties
@wmfairuz
wmfairuz / git-rm-deleted-files.sh
Created April 4, 2014 09:21
Find all deleted tracked files and git rm them
git ls-files --deleted -z | xargs -0 git rm