Skip to content

Instantly share code, notes, and snippets.

View jnh5y's full-sized avatar

James Hughes jnh5y

  • Confluent
  • Virginia, USA
View GitHub Profile
@jnh5y
jnh5y / JTSComparator.scala
Last active November 17, 2020 04:13
Quick Scala code for Comparing JTS Geometries considering the userData
import org.locationtech.jts.geom._
import java.util.Comparator
val comparator: Comparator[Point] = new Comparator[Point] {
override def compare(o1: Point, o2: Point): Int = {
println(s"Called compare with $o1 $o2")
if (o1 == null) {
+1
} else if(o2 == null) {
-1
@jnh5y
jnh5y / file1.txt
Created October 20, 2017 14:17
Created via API
Demo
@jnh5y
jnh5y / HadoopURLFactoryRegister.scala
Created April 17, 2016 19:01
Bean to register Hadoop URL StreamHandlerFactory
import java.net.URL
import org.apache.hadoop.fs.FsUrlStreamHandlerFactory
import org.apache.naming.resources.DirContextURLStreamHandlerFactory
class HadoopURLFactoryRegister {
println("Trying to register the Hadoop URL handlers.")
val factory = new FsUrlStreamHandlerFactory
@jnh5y
jnh5y / 0_reuse_code.js
Created January 31, 2014 19:41
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console