Skip to content

Instantly share code, notes, and snippets.

View fmamud's full-sized avatar
💻

Felipe Mamud fmamud

💻
View GitHub Profile
@fmamud
fmamud / gist:b545bf452597b034aef5
Created March 17, 2015 02:54
01-groovy-welcome.groovy
/*
________________ ______
/ ____/_ __/ __ \ / ____/________ ____ _ ____ __
/ /_ / / / / / / / / __/ ___/ __ \/ __ \ | / / / / /
/ __/ / / / /_/ / / /_/ / / / /_/ / /_/ / |/ / /_/ /
/_/ /_/ /_____/ \____/_/ \____/\____/|___/\__, /
/____/
12/03/2015
@ftmamud
@fmamud
fmamud / gist:3160d37e6a20b303bf9f
Created March 17, 2015 03:03
02-groovy-for-java-devs.groovy
/*
________________ ______
/ ____/_ __/ __ \ / ____/________ ____ _ ____ __
/ /_ / / / / / / / / __/ ___/ __ \/ __ \ | / / / / /
/ __/ / / / /_/ / / /_/ / / / /_/ / /_/ / |/ / /_/ /
/_/ /_/ /_____/ \____/_/ \____/\____/|___/\__, /
/____/
12/03/2015
@ftmamud
@fmamud
fmamud / JavaEmbedGroovy.java
Created March 17, 2015 03:06
Java Binding Embedding Groovy
import groovy.lang.Binding;
import groovy.lang.GroovyShell;
public class JavaEmbedGroovy {
public static void main(String[] args) {
Binding binding = new Binding();
binding.setVariable("evento", "FTD");
binding.setVariable("linguagem", "Groovy");
package forkjoin;
import java.util.concurrent.RecursiveTask;
public class FibonacciTask extends RecursiveTask<Long> {
/**
*
*/
private static final long serialVersionUID = 8826018716775533826L;
package forkjoin;
public class FibonacciProblem {
int n;
public FibonacciProblem(int n) {
this.n = n;
}
package forkjoin;
import java.math.BigInteger;
import java.util.concurrent.ForkJoinPool;
public class Main {
public static void main(String[] args) {
package forkjoin;
public class FibonacciProblem2 {
int n;
public FibonacciProblem2(int n) {
this.n = n;
}
package forkjoin;
import java.math.BigInteger;
public class FibonacciProblem3 {
BigInteger n;
public FibonacciProblem3(int n) {
this.n = BigInteger.valueOf(n);
package soujava.threads.java5;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class MainJava5 {
public static void main(String[] args) {
//Executor Framework
@fmamud
fmamud / pingpong.erl
Created October 27, 2015 18:44
Erlang ping & pong example
-module(pingpong).
-export([start/0, ping/2, pong/0]).
ping(0, Pong_PID) ->
Pong_PID ! finished,
io:format("Ping finished~n", []);
ping(N, Pong_PID) ->
Pong_PID ! {ping, self()},