Skip to content

Instantly share code, notes, and snippets.

@dacr
dacr / index.md
Last active November 17, 2024 18:09
David's programming examples knowledge base / published by https://github.com/dacr/code-examples-manager #fecafeca-feca-feca-feca-fecafecafeca/282b969338bec2e853b6db7eca83d809969279c2

David's programming examples knowledge base

akka-pekko

@maxpou
maxpou / github-page-travis.md
Last active March 20, 2023 04:02
Auto deploy on GitHub Pages when commit on master (with TravisCI)

Auto deploy on GitHub Pages when commit on master (with TravisCI)

Repo side

  1. touch .travis.yml
  2. Copy paste the following
language: node_js
node_js: stable
@paulp
paulp / macroImpl.scala
Last active September 2, 2016 16:20
Indirect compile-time literal types
class MacroBundle(val c: Context) {
/* etc */
/** Typecheck singleton types so as to obtain indirectly
* available known-at-compile-time values.
*/
object Const {
def unapply(tp: Type): Option[Constant] = tp match {
case ConstantType(c) => Some(c)
case SingleType(_, sym) => unapply(c.typecheck(q"$sym").tpe)
import scala.tools.nsc.interpreter._
import scala.tools.nsc.Settings
//USAGE EXAMPLE: import break._;break[someClass]("MainObject" -> MainObject)
object break{
def echo(x: Any) = Console.println(x)
def break[T: Manifest](args: NamedParam*) = {