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
@greenlaw110
greenlaw110 / gulp-sonar.js
Created October 6, 2016 00:07
Gulp task for sonar
var git = require('gulp-git');
var replace = require('gulp-replace');
var sonar = require('gulp-sonar');
var util = require('util');
/*
SONAR
*/
Tables Are Cool
col 1 is l $1600
col 2 is c $12
col 3 is a $1
@greenlaw110
greenlaw110 / resp_my_idea_framework.md
Created March 6, 2016 22:09
Respond to Rajesh 's post "My ideal framework" to playone group
  1. More RoRish framework (APIwise)

    If you are talking about expressiveness and developer friendly, I think ActFramework is really hitting this point!

  2. So that on scalability issue or JVM migration, people can easily switch to this framework. This will be a big selling point. (Migration script will be a bigggg selling point!)

    Comparing to Play, Act is using standard maven project layout, using maven to manage the dependencies, using google guice to manage the depedency injection. It's more easier for developer to move from place like SpringFramework. Actually I specifically designed Act so that it get the greatest part from Play but without those very special requirements on project layout/static method in controller etc in play.

  3. More RoRish in terms of convention over configuration

@greenlaw110
greenlaw110 / introduce to ActFramework.md
Last active March 6, 2016 07:22
Introduce ActFramework
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycom</groupId>
<artifactId>myapp</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>My Act Application</name>
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@greenlaw110
greenlaw110 / gist:bd773f1a283ec079102f
Created January 6, 2016 03:44
FastJson doesn't support serialize Iterable stuff
public class FastJsonSerializeIterableTest {
@Test
public void testWithIterable() {
class Person {
private String name;
public Person(String s) {
this.name = s;
}
public String getName() {
return name;
@args com.helper.myObj.MyObject myObj SKU, Group ID, Locale, Channel ID, Item ID, Status, Message1 ID, Message1, Message2 ID, Message2, Message3 ID, Message3, Message4 ID, Message4, Message5 ID, Message5
@for(com.helper.myObj.MyObject myObj : myObjects) {
@myObj.getSku(),@myObj.getGroupId(),@myObj.getLocale(), @myObj.getChannelId(), @myObj.getItemId(), @myObj.getOverallStatus(), @for(main.rythm.ErrorObject eo : myObj.getErrObj()).join(","){@eo.getErrId(),@eo.getErrMsg()}
}
@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 / 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) {