Skip to content

Instantly share code, notes, and snippets.

View rpomeroy's full-sized avatar

Ron Pomeroy rpomeroy

View GitHub Profile
@rpomeroy
rpomeroy / gist:bba52d8aed21004ebb1e
Created May 29, 2015 19:08
Error for maven-git-commit-id-plugin
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/ron/Documents/GitHub/rjp-test -Dmaven.home=/usr/local/Cellar/maven/3.3.3/libexec -Dclassworlds.conf=/usr/local/Cellar/maven/3.3.3/libexec/bin/m2.conf -Didea.launcher.port=7544 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 14.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/usr/local/Cellar/maven/3.3.3/libexec/boot/plexus-classworlds-2.5.2.jar:/Applications/IntelliJ IDEA 14.app/Contents/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=14.1.3 verify -P ci
[INFO] Scanning for projects...
[INFO]
[INFO] Using the MultiThreadedBuilder implementation with a thread count of 5
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building rjp-test 1.0.0-SNAPSHOT
[INFO] --------------------------------------------------
@rpomeroy
rpomeroy / gist:bccede2232a3c8fa6abe
Created September 29, 2014 05:19
Java 8 Collector for Google Guava SetMultimap
package com.github.gist.example.collectors;
import java.util.Collections;
import java.util.EnumSet;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collector;
@rpomeroy
rpomeroy / Reverse.java
Created August 4, 2014 21:49
Java Reverse a String
public static String reverse(String str) {
return new StringBuilder(str).reverse().toString();
}
public static String reverseString(String str) {
char[] chars = str.toCharArray();
String out = "";
for(int i = chars.length - 1; i < 0; i--) {
out += chars[i];
}
@rpomeroy
rpomeroy / FizzBuzz8.java
Created August 4, 2014 21:47
FizzBuzz Java 8
package exercises;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class FizzBuzz8 {
public static void main(String[] args) {
System.out.println(IntStream.range(1, 101).boxed()
.map(FizzBuzz8::fizzBuzz)
@rpomeroy
rpomeroy / FizzBuzzLamdas.java
Created July 31, 2014 07:40
FizzBuzz using Java 8 Functional approach
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class Main {
public static void main(String[] args) {
System.out.println(IntStream.range(1, 101).boxed()
.map(Main::fizzBuzz)
.collect(Collectors.joining(", ")));
}
@rpomeroy
rpomeroy / FizzBuzz.swift
Last active August 29, 2015 14:04
FizzBuzz in Swift (Playground)
// FizzBuzz problem in Swift (Playground)
import Foundation
println("\n\nClassic imperative - Print Fizz or Buzz or FizzBuzz")
for i in 1...100 {
var output = ""
if i % 3 == 0 {output += "Fizz"}
if i % 5 == 0 {output += "Buzz"}
print((output == "" ? "\(i)" : output) + ", ")
@rpomeroy
rpomeroy / gist:c0bf58a2c62f34fdad8d
Created July 20, 2014 20:04
NSColor from hex or hexString
// Paste in playground
// Handy NSColor and String extensions
import Cocoa
extension String {
func conformsTo(pattern: String) -> Bool {
let pattern = NSPredicate(format:"SELF MATCHES %@", pattern)
@rpomeroy
rpomeroy / hello.sh
Created June 28, 2014 19:41
Use Swift as a scripting language
#!/usr/bin/env xcrun swift -i
var str = "Hello, playground"
println(str)
@rpomeroy
rpomeroy / gist:6710371
Created September 26, 2013 06:00
How to keep eclipse and sbt class paths in sync when using ScalaIDE
After adding a new dependency to your build.sbt file...
sbt> reload
sbt> eclipse with-source=true
After it completes refresh the project in the ide