Skip to content

Instantly share code, notes, and snippets.

View greenlaw110's full-sized avatar
🏠
Working from home

Gelin Luo greenlaw110

🏠
Working from home
  • @AWS/Redshift/CP
  • Sydney Australia
View GitHub Profile
import com.pixolut.mrb.mas.tool.*;
import com.pixolut.mrb.mas.models.*;
import com.pixolut.mrb.mas.controllers.*;
import java.util.*;
import org.rythmengine.template.TemplateBase;
import java.io.*;
public class errors_prod_error_html__R_T_C__ extends org.rythmengine.template.TagBase {
@Override public java.lang.String __getName() {
@greenlaw110
greenlaw110 / layout.html
Created April 13, 2014 10:13
layout template with @inherited()
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>title</title>
<meta charset="UTF-8">
@greenlaw110
greenlaw110 / Output
Created June 4, 2014 03:40
YieldExample output
T:\java>java YieldExample
I am Consumer : Consumed Item 0
I am Producer : Produced Item 0
I am Consumer : Consumed Item 1
I am Producer : Produced Item 1
I am Consumer : Consumed Item 2
I am Producer : Produced Item 2
I am Producer : Produced Item 3
I am Consumer : Consumed Item 3
I am Consumer : Consumed Item 4
@greenlaw110
greenlaw110 / SortIntArray.java
Last active August 29, 2015 14:04
Sort array by number symbol, negative should all go left and positive should all go right
import java.util.Arrays;
/**
* Created by luog on 22/07/2014.
*/
public class SortIntArray {
private static int[] ia;
private static void initArray(String[] args) {
if (args.length > 0) {
@greenlaw110
greenlaw110 / Demo.java
Last active August 29, 2015 14:11 — forked from harlanji/Demo.java
MongoTemplate mongo = ...;
List<Converter> converters = new ArrayList<Converter>();
converters.add(new Converter<DBObject, Participant>() {
public Participant convert(DBObject s) {
throw new UnsupportedOperationException("Not supported yet 1.");
}
});
converters.add(new Converter<Participant, DBObject>() {
@greenlaw110
greenlaw110 / dependencies.yml
Created April 18, 2012 03:00
Playframework dependencies.yml file to use PlayRythm pre-release version
# this is not maintained, please refer to https://gist.github.com/2868365 for latest version
For example, you have a part of content to be passed to different tags as callback, and you except the tag will change the content by passing arguments, as shown below:
bc. @lookupRole(permission: "superuser").callback(List<Role> roleList) {
<ul>
@for(Role role: roleList) {
<li>role.getName()</li>
}
</ul>
}
@greenlaw110
greenlaw110 / dependencies.yml
Created May 28, 2012 01:39
Playframework dependencies.yml file to use PlayMorphia pre-release version
# this is not maintained. Please refer to https://gist.github.com/2868365 for latest morphia version
@greenlaw110
greenlaw110 / look-for-pid-on-port.sh
Created June 4, 2012 20:36
Find which process is bind to a specific port
sudo netstat -anp|grep <port-number>
@greenlaw110
greenlaw110 / _aaa.yml
Created June 12, 2012 07:27
Play-aaa configuration file
# ----------------
# Privileges
# ----------------
superuser:
type: p
level: 9999
# ---------------
# Rights
# ---------------