Skip to content

Instantly share code, notes, and snippets.

@dacr
dacr / index.md
Last active December 15, 2025 17:29
David's programming examples knowledge base / published by https://github.com/dacr/code-examples-manager #fecafeca-feca-feca-feca-fecafecafeca/e167db24271e30e7734219d0c240c351ac3cd300

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*) = {