digraph git_objects {
commit -> tree;
tree -> file1;
tree -> file2;
tree -> file3;
tree -> filen;
}
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 Reader<R, A> { | |
| private final Function<R, A> run; | |
| public Reader(Function<R, A> run) { this.run = run; } | |
| public <B> Reader<R, B> map(Function<A, B> f) { | |
| return new Reader<>( r -> f.apply((apply(r))) ); | |
| } | |
| public <B> Reader<R, B> flatMap(Function<A, Reader<R, B>> f) { |
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
| counter = 1 | |
| -- Initialize the pseudo random number generator - http://lua-users.org/wiki/MathLibraryTutorial | |
| math.randomseed(os.time()) | |
| math.random(); math.random(); math.random() | |
| function file_exists(file) | |
| local f = io.open(file, "rb") | |
| if f then f:close() end | |
| return f ~= nil |
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
| # $ gem install sinatra | |
| require 'sinatra' | |
| get '/hi' do | |
| "Hello World!" | |
| end |
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
| apply plugin: 'idea' | |
| idea { | |
| project { | |
| jdkName "1.8" | |
| languageLevel "1.8" | |
| ipr { | |
| withXml { provider -> | |
| def node = provider.asNode() | |
| node.component.find { it.'@name' == 'VcsDirectoryMappings' }?.mapping[0].'@vcs' = 'Git' |
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
| package ratpack.groovy | |
| import com.google.inject.AbstractModule | |
| import ratpack.groovy.test.embed.GroovyEmbeddedApp | |
| import ratpack.guice.Guice | |
| import spock.lang.Specification | |
| class EmbeddedSpec extends Specification { | |
| def "GroovyEmbeddedApp with Guice Module"() { | |
| given: |
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
| export JDK6="/c/Program Files/Java/jdk1.6.0_29" | |
| export JDK7="/c/Program Files/Java/jdk1.7.0_71" | |
| export JDK8="/c/Program Files/Java/jdk1.8.0_25" | |
| export OPENJDK8="/c/Program Files/Java/zulu1.8.0_25-8.4.0.1-win64" | |
| alias java6='export JAVA_HOME="$JDK6";export PATH="$JDK6/bin":$PATH' | |
| alias java7='export JAVA_HOME="$JDK7";export PATH="$JDK7/bin":$PATH' | |
| alias java8='export JAVA_HOME="$JDK8";export PATH="$JDK8/bin":$PATH' | |
| alias zulujava8='export JAVA_HOME="$OPENJDK8";export PATH="$OPENJDK8/bin":$PATH' |
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
| @GrabResolver(name="OJO", root="https://oss.jfrog.org/artifactory/repo") | |
| @Grab("io.ratpack:ratpack-groovy:0.9.18-SNAPSHOT") | |
| import static ratpack.groovy.Groovy.ratpack | |
| ratpack { | |
| handlers { | |
| get { | |
| render "Hello, World" | |
| } | |
| } |
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 ratpack.exec.Operation; | |
| import ratpack.exec.Promise; | |
| import ratpack.guice.Guice; | |
| import ratpack.handling.Context; | |
| import ratpack.session.Session; | |
| import ratpack.session.SessionKey; | |
| import ratpack.session.SessionModule; | |
| import ratpack.test.embed.EmbeddedApp; | |
| import static org.junit.Assert.assertEquals; |
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
| // before | |
| private String getExpandValuesFromSet (Set<String> valueSet, Boolean surroundValueWithQuotes) { | |
| StringBuilder expansionValuesString = new StringBuilder(" ("); | |
| Iterator<String> valueIterator = valueSet.iterator(); | |
| if (valueIterator.hasNext()) { | |
| String value = valueIterator.next(); | |
| if (surroundValueWithQuotes) { | |
| expansionValuesString.append("'" + value + "'"); |