Skip to content

Instantly share code, notes, and snippets.

View clhodapp's full-sized avatar

Chris Hodapp clhodapp

  • San Francisco, California
View GitHub Profile
{
"/nix/store/icq00fiahql9p3gw2bkgkh6s02hk03bf-redis-6.2.6.drv": {
"args": [
"-e",
"/nix/store/9krlzvny65gdc8s7kpb6lkx8cd02c25b-default-builder.sh"
],
"builder": "/nix/store/pbfraw351mksnkp2ni9c4rkc9cpp89iv-bash-5.1-p12/bin/bash",
"env": {
"NIX_CFLAGS_COMPILE": "",
"NIX_HARDENING_ENABLE": "fortify stackprotector pic strictoverflow format relro bindnow pie",
{tree-sitter, linkFarm, lib}:
let
make-tree-sitter-libs = grammarFn: (
let
grammars = grammarFn tree-sitter.builtGrammars;
nameForEmacs = origName: (
let truncated = (lib.strings.removeSuffix "-grammar" origName);
in "lib" + truncated + ".so"
);
linkParser = drv: (
$ scala
Welcome to Scala 2.12.4 (OpenJDK 64-Bit Server VM, Java 1.8.0_121).
Type in expressions for evaluation. Or try :help.
scala> :paste
// Entering paste mode (ctrl-D to finish)
case class Setting[T](
key: String,
value: T
@clhodapp
clhodapp / affirmation
Created October 28, 2016 07:06
MuleSoft Contributor Agreement Acceptance by Chris Hodapp
I, Chris Hodapp, have read and do accept the MuleSoft Contributor Agreement
at http://www.mulesoft.org/legal/contributor-agreement.html
Accepted on Fri Oct 28 2016 00:07:21 GMT-0700 (PDT)
$ scala -language:_
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45).
Type in expressions for evaluation. Or try :help.
scala> import reflect.macros.whitebox.Context
import reflect.macros.whitebox.Context
scala> def idImpl(c: Context)(t: c.Tree): c.Tree = t
idImpl: (c: scala.reflect.macros.whitebox.Context)(t: c.Tree)c.Tree
def foo = """hello
there
chris"""
Welcome to Scala 2.12.0-M3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45).
Type in expressions for evaluation. Or try :help.
scala> :paste
// Entering paste mode (ctrl-D to finish)
trait Foo[A]
object Foo {
@annotation.implicitAmbiguous("Custom ambiguous message")
implicit val a = new Foo[String] { }
Welcome to Scala 2.12.0-M3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45).
Type in expressions for evaluation. Or try :help.
scala> :paste
// Entering paste mode (ctrl-D to finish)
trait Foo[A]
object Foo {
@annotation.implicitAmbiguous("Custom ambiguous message")
implicit def a = new Foo[String] { }
import reflect.runtime.universe._
import reflect.runtime.currentMirror
import scala.tools.reflect.ToolBox
class Demo[T: TypeTag] {
def runTest(): Any = {
val tb = currentMirror.mkToolBox()
val companion = typeOf[T].typeSymbol.companion
tb.eval(q"$companion.test")
[info] Loading global plugins from /Users/clhodapp/.sbt/0.13/plugins
[info] Set current project to tmp (in build file:/Users/clhodapp/tmp/)
> set libraryDependencies += "junit" % "junit" % "latest.release"
[info] Defining *:libraryDependencies
[info] The new value will be used by *:allDependencies
[info] Reapplying settings...
[info] Set current project to tmp (in build file:/Users/clhodapp/tmp/)
> console
[info] Updating {file:/Users/clhodapp/tmp/}tmp...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...