This file contains hidden or 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
-module(vamos). | |
-author("fmamud"). | |
-export([foreach/2, valid_time/1, show_me_your_name/2, can_i_drink/1, oh_god/1, odd_even/1, beach/1, show_macro/2]). | |
-define(TIMEOUT, 20). | |
-define(SOMA(X, Y), X + Y). | |
foreach(Fun, [H|T]) -> | |
Fun(H), |
This file contains hidden or 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
-module(records). | |
-compile(export_all). | |
-include("records.hrl"). | |
-record(robot, {name, | |
type=industrial, | |
hobbies, | |
details=[]}). | |
-record(user, {id, name, group, age}). |
This file contains hidden or 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
-module(bora). | |
-export([echo/1,fibonacci/1,mysum/1, reverse/1]). | |
echo(Any) -> Any. | |
fibonacci(0) -> 1; | |
fibonacci(1) -> 1; | |
fibonacci(N) -> fibonacci(N-1) + fibonacci(N-2). | |
This file contains hidden or 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 FibInfiniteLoop { | |
static void fib(long n) { | |
int a = 0, b = 1; | |
while (a < n) { | |
System.out.printf("%d %n", a); | |
a = b; | |
b = a + b; | |
} | |
} |
This file contains hidden or 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 java.io.InputStream; | |
import java.net.InetSocketAddress; | |
import java.net.Proxy; | |
import java.net.Proxy.Type; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
public class HttpFileGet { |
This file contains hidden or 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
@Grapes([ | |
@Grab("org.gebish:geb-core:0.12.2"), | |
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.45.0"), | |
@Grab("org.seleniumhq.selenium:selenium-support:2.45.0") | |
]) | |
import geb.Browser | |
Browser.drive { | |
go "https://en.wikipedia.org/wiki/Groovy_(programming_language)" | |
This file contains hidden or 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
# Windows | |
set JAVA_OPTS=-Dhttp.proxyHost=yourproxy -Dhttp.proxyPort=8080 | |
# Unix | |
export JAVA_OPTS=-Dhttp.proxyHost=yourproxy -Dhttp.proxyPort=8080 |
This file contains hidden or 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
iwr -OutFile ~/.groovy/grapeConfig.xml https://gist.githubusercontent.com/lalyos/9366690/raw/grapeConfig.xml |
This file contains hidden or 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 hello (...c) { | |
c.each {it.call()} | |
} | |
hello ({println 'hello'},{println 'namaste'}, {println 'hola'}) |
This file contains hidden or 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
@Grab('org.codehaus.gpars:gpars:1.2.1') | |
import static groovyx.gpars.GParsPool.* | |
import groovy.json.JsonSlurper | |
orgid = 0 | |
orgname = 'X' | |
username = '' | |
token = 'X' |