Skip to content

Instantly share code, notes, and snippets.

https://www.slf4j.org/legacy.html
- `slf4j-log4j12`: use log4j12 as a binding
- `log4j-over-slf4j` - route the Log4j API calls to SLF4J (for libs that use log4j)
- `jcl-over-slf4j` -
@tori3852
tori3852 / chrome-proxy.sh
Created January 6, 2019 20:30
Chrome Proxy
$ open -a "/Applications/Google Chrome.app" --args --incognito --proxy-server="https=193.201.32.251:55520" https://www.netflix.com/ https://whatismyipaddress.com/
@tori3852
tori3852 / build.gradle
Created July 13, 2018 14:55
Gradle integration tests folder (no auto execution)
configurations {
integrationTestImplementation.extendsFrom testImplementation
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}
sourceSets {
integrationTest {
java {
@tori3852
tori3852 / build.gradle
Created July 13, 2018 14:51
Gradle test logging
test {
testLogging.showStandardStreams = true
}
mvn dependency:tree -Doutput=new.log
git checkout HEAD~1
mvn dependency:tree -Doutput=old.log
diff old.log new.log | grep "^[><]" | sed "s/^\([><]\).*\- /\1 /" | sort
@tori3852
tori3852 / h2cte.sh
Created February 9, 2018 09:24
Run h2 locally
mvn dependency:get -Dartifact='com.h2database:h2:1.4.196'
java -jar ~/.m2/repository/com/h2database/h2/1.4.196/h2-1.4.196.jar &
java -cp ~/.m2/repository/com/h2database/h2/1.4.196/h2-1.4.196.jar org.h2.tools.RunScript -url jdbc:h2:~/test -user sa -showResults -script <(cat <<EOF
WITH RECURSIVE fibonacci (n, fib_n, next_fib_n) AS
(
SELECT 1, 0, 1
UNION ALL
SELECT n + 1, next_fib_n, fib_n + next_fib_n
FROM fibonacci WHERE n < 10
)
@tori3852
tori3852 / build.sbt
Created August 7, 2016 20:03
Scala style checkeck (sbt project)
(scalastyleConfigUrl in Compile) := Some(url("https://gist.githubusercontent.com/tori3852/b6d29f650b9d207ebe6f2211a0a53648/raw/scalastyle_config.xml"))
(scalastyleConfigUrl in Test) := Some(url("https://gist.githubusercontent.com/tori3852/b6d29f650b9d207ebe6f2211a0a53648/raw/scalastyle_config.xml"))
// checkstyle on compile
lazy val compileScalastyle = taskKey[Unit]("compileScalastyle")
compileScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Compile).toTask("").value
@tori3852
tori3852 / scalastyle_config.xml
Last active August 9, 2016 20:09
Scalastyle config file
<scalastyle commentFilter="enabled">
<name>Scalastyle standard configuration</name>
<check level="error" class="org.scalastyle.file.FileTabChecker" enabled="true"/>
<check level="warning" class="org.scalastyle.file.FileLengthChecker" enabled="true">
<parameters>
<parameter name="maxFileLength"><![CDATA[800]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.file.HeaderMatchesChecker" enabled="false">
<parameters>
@tori3852
tori3852 / pom.xml
Last active August 7, 2016 19:22
Scala style checkeck (Maven project)
<project>
<build>
<plugins>
<plugin>
<groupId>org.scalastyle</groupId>
<artifactId>scalastyle-maven-plugin</artifactId>
<version>0.8.0</version>
<configuration>
<verbose>false</verbose>
<failOnViolation>true</failOnViolation>
@tori3852
tori3852 / rstudio.sh
Last active March 4, 2021 17:26
Install RStudio on Fedora
sudo dnf install -y $(curl -s https://rstudio.com/products/rstudio/download/ | grep "fedora" | grep -o "\"[^ \"]*x86_64.rpm\"" | sed "s/\"//g")