This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
def birth | |
def death | |
} | |
def people = [ | |
new Person(birth: 1960, death: 1971), | |
new Person(birth: 1960, death: 1972), | |
new Person(birth: 1960, death: 1972), | |
new Person(birth: 1965, death: 1971), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Recursion { | |
public static String reverse(String str) { | |
if (null == str || str.length() <= 1) { | |
return str; | |
} | |
return reverse(str.substring(1)) + str.charAt(0); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p web-app | |
unzip -o frontend/target/app.zip -d web-app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export DISPLAY=:1 | |
Xvfb :1 & | |
# | |
# Fetch node if we don't have it already | |
# | |
node_version=v0.10.16 | |
install_name=node-$node_version-linux-x64 | |
node_home=$PWD/$install_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export DISPLAY=:1 | |
Xvfb :1 & | |
# | |
# Fetch node and testacular if we don't have it already | |
# | |
node_version=v0.10.16 | |
install_name=node-$node_version-linux-x64 | |
node_home=$PWD/$install_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-antrun-plugin</artifactId> | |
<executions> | |
<execution> | |
<id>generate-resources</id> | |
<phase>generate-resources</phase> | |
<configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private List findProductsWithTotal(Invoice[] invoices, int total) { | |
List result = new LinkedList(); | |
for (Invoice invoice : invoices) { | |
if(invoice.total() > 7000){ | |
result.add(invoice); | |
} | |
} | |
return result; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Invoice { | |
List items | |
Date date | |
} | |
class Product { | |
String name | |
int dollar | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def text = "The return of the thin white duke" | |
def reverse(String text) { | |
text.split("\\s+").collect { it.reverse() }.join(' ') | |
} | |
assert reverse(text) == "ehT nruter fo eht niht etihw ekud" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.gson.Gson; | |
import org.apache.commons.codec.binary.Base64; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import java.io.*; | |
import java.net.URLEncoder; | |
import java.util.HashMap; |
NewerOlder