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
import org.apache.kafka.clients.consumer.KafkaConsumer | |
import org.apache.kafka.common.serialization.{Deserializer, StringDeserializer} | |
import org.apache.kafka.common.utils.ByteUtils | |
/** | |
* Not recommended for production but useful when you want to write some kind of | |
* quick script that reads data off kafka. | |
*/ | |
object ReadData { | |
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 com.goswiftly.http2ftp; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import java.net.URL; | |
import java.util.Base64; | |
import static spark.Spark.*; |
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 com.goswiftly.services.gtfspoller.jacksonutil; | |
import com.fasterxml.jackson.core.JsonParser; | |
import com.fasterxml.jackson.databind.DeserializationContext; | |
import com.fasterxml.jackson.databind.JsonDeserializer; | |
import io.vavr.control.Try; | |
import java.util.NoSuchElementException; | |
public class Deserializers { |
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
from typing import Generator, Tuple, Set, List | |
from sqlalchemy import inspect, create_engine | |
import sys | |
GeneratorOfDiscrepancies = Generator[Tuple[str, str], None, None] | |
class InspectorWrapper: | |
def __init__(self, url: str): |
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 domain | |
case class Choice(name: String) extends AnyVal | |
case class Ballot(topChoice: Choice, next: List[Choice]) { | |
def eliminateChoice(choice: Choice): Option[Ballot] = | |
if (topChoice == choice) { | |
next match { | |
case Nil => None |
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
import shapeless.{::, HList, HNil} | |
import shapeless.LUBConstraint._ | |
import shapeless.ops.hlist.ToTraversable._ | |
import scala.util.Try | |
import shapeless.ops.hlist._ | |
object Path { | |
def /(s: String) = Path(PathLiteral(s) :: HNil) |
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
import sys | |
import argparse | |
import time | |
from subprocess import call | |
parser = argparse.ArgumentParser(description='Run a command for every line in a file, slowly.') | |
parser.add_argument('-s', type=float, help="Amount of seconds to sleep between commands", default=1.0) | |
parser.add_argument('file', type=file) | |
parser.add_argument('prefix', nargs=argparse.REMAINDER) |
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
import java.sql.Timestamp | |
import java.time.{Duration, Instant} | |
import slick.driver.JdbcProfile | |
import slick.profile.SqlProfile.ColumnOption.Nullable | |
import scala.concurrent.{ExecutionContext, Future} | |
import scala.util.{Failure, Success} | |
/** |
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
import java.util | |
import java.util.Map.Entry | |
import akka.http.scaladsl.model.HttpHeader | |
import io.opentracing.propagation.TextMap | |
import scala.collection.JavaConverters.asJavaIteratorConverter | |
/** | |
* Used to extract an iterator of Entry[String, String] to the |
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 gist.chadselph | |
import akka.http.scaladsl.server.PathMatcher | |
import akka.http.scaladsl.server._ | |
import akka.http.scaladsl.server.Directives._ | |
import akka.http.scaladsl.server.util.ApplyConverter | |
/** | |
* Created by chad on 11/4/16. | |
*/ |
NewerOlder