I hereby claim:
- I am shanedelmore on github.
- I am shanedelmore (https://keybase.io/shanedelmore) on keybase.
- I have a public key ASCjD-4yeo9keUkltfhWRotlwERtREAP0_piYbBacvX0cAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| package scalafix.util | |
| import scala.collection.immutable.Seq | |
| import scala.meta._ | |
| import syntax._ | |
| object Import { | |
| def remove(prefix: String, term: String): PartialFunction[Tree, Tree] = { | |
| case b @ q"{ ..$stats }" /* verify targeted term exists */ => | |
| val newStats: Seq[Stat] = stats.collect { |
| import org.scalacheck.Arbitrary | |
| import org.scalacheck.Arbitrary._ | |
| trait Tagged[+V, +T] | |
| type @@[+V, +T] = V with Tagged[V, T] | |
| trait Safe | |
| implicit val arbitrarySafeString: Arbitrary[String @@ Safe] = | |
| Arbitrary( |
| package org.scalafmt.rewrite | |
| import scala.meta.Tree | |
| import scala.meta._ | |
| import scala.meta.tokens.Token.{LeftBrace, LeftBracket, LeftParen, RightBrace, RightBracket, RightParen} | |
| //Do we need a way to link certain types together (meta or scalafmt)? | |
| object Balanced { | |
| val matchingParens: (Token => Boolean, Token => Boolean) = | |
| (_.is[LeftParen], _.is[RightParen]) |
| //scalafmt returns: error: illegal start of simple expression | |
| def validStringLength(min: Int, max: Int): String => Boolean = { | |
| s => | |
| val len: Int = s.length | |
| (min <= len) && (len <= max) | |
| } | |
| //scalafmt is fine with this | |
| def validStringLength(min: Int, max: Int): String => String => Boolean = | |
| s => { |
| import scala.collection._ | |
| import scala.collection.generic._ | |
| implicit class TraversableLikeOps[+T, +Repr](val seq: SeqLike[T, Repr]) { | |
| def zipWithNext[That](implicit c: CanBuildFrom[Repr, (T, T), That]): That = { | |
| val builder = c(seq.repr) | |
| val is = seq.toIndexedSeq | |
| builder ++= is.zip(is.drop(1)) | |
| builder.result | |
| } |
| val testString = | |
| """ | |
| |PROJECT_DIR=$(cd "${BASH_SOURCE[0]%/*}" && pwd -P)/../.. | |
| | | |
| |MAINCLASS=com.business.service.MyService | |
| | | |
| | | |
| |exec java $JAVA_OPTS -cp "$PROJECT_DIR/my_service/target/scala-2.11/classes" "$MAINCLASS" "$@" | |
| | | |
| """.stripMargin |
| import slick.dbio.{DBIOAction, NoStream} | |
| import com.shane.db.models.Slick3PostgresDriver.api.Database | |
| import scala.concurrent.Future | |
| trait QueryExecutor { | |
| def run[R](action: DBIOAction[R, NoStream, Nothing]): Future[R] | |
| def runExtended[R](action: DBIOAction[R, NoStream, Nothing]): Future[R] = run(action) | |
| } |
| #!/usr/bin/env amm | |
| //Requirements: | |
| // This only runs on OSX as it uses OSX Keychain to store your Bamboo login credentials | |
| // Tested with Ammonite 0.7.0 | |
| import ammonite.ops._ | |
| import $ivy.`org.scalaj::scalaj-http:2.2.0`, scalaj.http._ | |
| import $ivy.`org.json4s::json4s-native:3.4.0`, org.json4s._, native.JsonMethods._ | |
| import java.net.SocketTimeoutException | |
| implicit val formats = DefaultFormats //Bring default json formats into scope | |
| implicit val wd = cwd //set working directory to current working directory |
| //Depends on https://github.com/nestorpersist/logging | |
| import java.net.InetAddress | |
| import akka.actor.ActorSystem | |
| import com.persist.logging.{ ClassLogging, Logger, LoggingSystem } | |
| /** | |
| * The purpose of this object is to provide a shared logger for use throughout the program | |
| * To use instead of mixing ClassLogging into a class use the following import: | |
| * import TheLogger.{ logInstance => log } |