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
/** | |
* http://stackoverflow.com/questions/17875576/gradle-projects-depending-on-artifacts-created-by-sibling-projects | |
*/ | |
apply plugin: 'java' | |
repositories { | |
mavenCentral() | |
} |
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
// matcher | |
def m = "foo-bar" =~ /(.+)(-)(.+)/ | |
println m[0] | |
println m[0][1] | |
println m[0][2] | |
println m[0][3] | |
assert m[0] == ["foo-bar", "foo", "-", "bar"] |
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
set dm_t_branch="dir" | |
set dm_ear=%dm_t_branch%\xxx.ear | |
set dm_war=%dm_t_branch%\yyy.war | |
jar -tf %dm_ear% | grep "lib/" | grep -v "^dm-"| sed -e "s:lib/::g" > gradle-ear-libs-jars.txt | |
jar -tf %dm_war% | grep "WEB-INF/lib/" | sed -e "s:WEB-INF/lib/::g" > gradle-libs-jars.txt | |
cat gradle-ear-libs-jars.txt > zjunk.txt | |
cat gradle-libs-jars.txt >> zjunk.txt | |
grep -v "^dm-" zjunk.txt | sort > 2-gradle-total-ear-war-jars.txt |
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
http://stackoverflow.com/questions/23164157/getting-intellij-idea-13-to-recognize-gradle-module-interdependencies |
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
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic apache_log --from-beginning |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
// Keywords | |
<- // Used on for-comprehensions, to separate pattern from generator | |
=> // Used for function types, function literals and import renaming | |
// Reserved | |
( ) // Delimit expressions and parameters | |
[ ] // Delimit type parameters | |
{ } // Delimit blocks | |
. // Method call and path separator | |
// /* */ // Comments |
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
http://www.scala-lang.org/old/node/8194.html | |
http://stackoverflow.com/questions/4017357/difference-between-this-and-self-in-self-type-annotations | |
3 forms: | |
trait A {self: B =>..} | |
trait A {self =>..} | |
trait A {this: B =>..} | |
trait A {self: B =>..} is the most useful one. used primary for mixins. | |
'A' implements a small groups of very specific operations for very generic type. 'B' could be potentially implements another a small group. |
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
http://blogs.atlassian.com/2013/01/covariance-and-contravariance-in-scala/ | |
trait Function1[-T1, +R] { | |
def apply(t : T1) : R | |
... | |
} | |
This is single arg function in scala - T1 is basically input, R is output. | |
Any single arg function extends from this. And think through this rationally: | |
-T1 -> input needs to be less restrictive |
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
package junk | |
import com.amazonaws.{AmazonClientException, AmazonServiceException, ClientConfiguration} | |
import com.amazonaws.auth.{AWSStaticCredentialsProvider, BasicAWSCredentials} | |
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration | |
import com.amazonaws.services.s3.{AmazonS3Client, AmazonS3ClientBuilder, S3ClientOptions} | |
import com.amazonaws.services.s3.model.Bucket | |
import scala.collection.JavaConversions._ | |
import com.amazonaws.services.s3.model.PutObjectRequest |