Skip to content

Instantly share code, notes, and snippets.

@dacr
dacr / index.md
Last active May 11, 2025 11:26
David's programming examples knowledge base / published by https://github.com/dacr/code-examples-manager #fecafeca-feca-feca-feca-fecafecafeca/6e82bf2949cc61c919535ce35a58ebc93721c33

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