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.pulseenergy.calorificvalues; | |
import com.pulseenergy.core.quantity.Quantity; | |
import com.pulseenergy.core.quantity.Resource; | |
import com.pulseenergy.point.CorePointKey; | |
import com.pulseenergy.point.Point; | |
import com.pulseenergy.point.conversion.PointConverter; | |
import com.pulseenergy.point.model.EnergyPointModel; | |
import com.pulseenergy.space.Space; |
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 com.typesafe.config.{ConfigFactory, Config} | |
trait Configuration { | |
val config: Config = ConfigFactory.load() | |
} | |
trait Configured[+C <: Configuration] { | |
def configuration: C | |
} |
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 fpinscala | |
object Ch10 { | |
trait Monoid[T] { | |
def op(x: T, y: T): T | |
def zero: T | |
} | |
// 10.1 |
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.pulseenergy.lassie.translations | |
import org.scalacheck.{Arbitrary, Gen, Commands} | |
import org.scalacheck.Arbitrary.arbitrary | |
import org.scalacheck.Gen._ | |
import org.scalatest.{Matchers, FlatSpec} | |
import org.scalatest.prop.{PropertyChecks, Checkers} | |
class Counter { |
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
object AtlasClient2 { | |
case class Settings(url: String, authorization: String, version: String, dbService: String) | |
object Settings { | |
def fromConfig(config: Config) = Settings("foo","bar","baz","boo") | |
} | |
def apply(settings: Settings) = new AtlasClient2(settings) | |
def apply(config: Config = ConfigFactory.load()) = new AtlasClient2(Settings.fromConfig(config)) | |
} |
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
[trace] Stack trace suppressed: run last *:publishSigned for the full output. | |
[error] (*:publishSigned) java.io.IOException: Access to URL https://oss.sonatype.org/content/repositories/snapshots/default/multiindex_2.11/0.0.1-SNAPSHOT/multiindex_2.11-0.0.1-SNAPSHOT.jar was refused by the server: Forbidden | |
[error] Total time: 17 s, completed 2-Oct-2016 1:24:36 PM |
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
CREATE TABLE my_keyspace.slots ( | |
day int, | |
skuid text, | |
priority int, | |
badge text, | |
PRIMARY KEY ((day, skuid), priority) | |
); | |
CREATE TABLE my_keyspace.skus_by_badge ( | |
badge text, |
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.nio.file.{Path, Paths} | |
import better.files.File.OpenOptions | |
import org.apache.commons.compress | |
import better.files._ | |
import org.apache.commons.compress.archivers.ArchiveStreamFactory | |
import org.apache.commons.compress.archivers.tar.{TarArchiveEntry, TarArchiveInputStream} | |
object TarFile { | |
val mb = 1024 * 1024 |
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
# Set a Ctrl-b shortcut for reloading your tmux config | |
bind r source-file ~/.tmux.conf | |
# For no time after pressing ESC, should we consider ALT to be pressed down | |
# (Why was that default in the first place???) | |
set -g escape-time 0 | |
# switch panes using Alt-arrow without prefix | |
bind -n M-Left select-pane -L | |
bind -n M-Right select-pane -R |
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
object OtherMain extends App { | |
import scala.concurrent.{ExecutionContext, Future} | |
import java.util.concurrent.{ArrayBlockingQueue, Executors, ThreadPoolExecutor, TimeUnit} | |
val numWorkers = 2 | |
val queueCapacity = 10 | |
val q = | |
new ArrayBlockingQueue[Runnable](queueCapacity) { | |
override def offer(e: Runnable) = { |