Skip to content

Instantly share code, notes, and snippets.

David Raviv davidraviv

Block or report user

Report or block davidraviv

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davidraviv
davidraviv / PrintLogoToConsole.java
Created May 19, 2014
From http://stackoverflow.com/questions/3886201/java-outputting-text-file-to-console Print the content of a text file to the console. I used it to print a logo.
View PrintLogoToConsole.java
try {
// draw logo to console
InputStream input = new BufferedInputStream(new FileInputStream("src/main/resources/logo.txt"));
byte[] buffer = new byte[8192];
try {
for (int length = 0; (length = input.read(buffer)) != -1;) {
System.out.write(buffer, 0, length);
}
} finally {
@davidraviv
davidraviv / 0_reuse_code.js
Created May 19, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@davidraviv
davidraviv / ActionFactory.java
Last active Aug 29, 2015
Simple singleton factory to create class implementing Action interface.The constructor for creating the class is cached internally to reuse in the next invokation.In the className implementation is missing, this factory returns null.* Action is proprietary interface, can be replaced with any other interface. JsonNode is the constructor input for…
View ActionFactory.java
package com.company.product
import com.fasterxml.jackson.databind.JsonNode;
import org.apache.log4j.Logger;
import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.Map;
/**
@davidraviv
davidraviv / generate_wsdl_pom.xml
Created Apr 17, 2014
Add this to the build part of a pom.xml to generate wsdl related classes. The wsdl is expected to be locally stored under src/main/resources/wsdl
View generate_wsdl_pom.xml
<build>
<plugins>
<!--Generate wsdl related classes-->
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
@davidraviv
davidraviv / scala_complie_package_pom.xml
Created Mar 27, 2014
Compile and package a scala code to a single jar. Also includes dependencies for json4s that can be omitted.
View scala_complie_package_pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wm</groupId>
<artifactId>wmLogger</artifactId>
<version>1.0-SNAPSHOT</version>
@davidraviv
davidraviv / basic_scala_pom.xml
Created Mar 27, 2014
Basic maven pom.xml that allows building a scala project. No need to prior install scala.
View basic_scala_pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wm</groupId>
<artifactId>wmLogger</artifactId>
<version>1.0-SNAPSHOT</version>
You can’t perform that action at this time.