I hereby claim:
- I am joprice on github.
- I am josephprice (https://keybase.io/josephprice) on keybase.
- I have a public key ASDI8mz2qoozt20aX1FZXjB6ELk1BAewQ_bpwUoGbczsmAo
To claim this, I am signing this object:
function debug() { | |
var args = Array.prototype.slice.call(arguments).join(",") | |
var script = ["console.log(", args, ")"].join('') | |
chrome.devtools.inspectedWindow.eval(script); | |
} |
import scala.language.experimental.macros | |
import scala.reflect.macros.blackbox.Context | |
import play.api.libs.json.{Format, Writes, Reads, OWrites} | |
object PlayJson{ | |
def reads[A <: AnyRef]: Reads[A] = macro readsImpl[A] | |
def readsImpl[A <: AnyRef : c.WeakTypeTag](c: Context): c.Expr[Reads[A]] = { | |
import c.universe._ |
/** | |
Before: | |
0: getstatic #19 // Field test/Eq$.MODULE$:Ltest/Eq$; | |
3: iload_1 | |
4: invokestatic #25 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; | |
7: getstatic #30 // Field test/Eq$intEq$.MODULE$:Ltest/Eq$intEq$; | |
10: invokevirtual #34 // Method test/Eq$.EqOps:(Ljava/lang/Object;Ltest/Eq;)Ltest/Eq$EqOps; | |
13: iload_2 |
// allows converting one class to another by providing missing fields | |
object convert { | |
@annotation.implicitNotFound(""" | |
You have not provided enough arguments to convert from ${In} to ${Out}. | |
${Args} | |
""") | |
trait Convertible[Args, In, Out] { | |
def apply(args: Args, in: In): Out | |
} |
trait AnimalMouth | |
class Beak extends AnimalMouth | |
object Test1 { | |
//================================Generic type works as in the following ======================= | |
trait Animal[Mouth <: AnimalMouth] { | |
def mouth : Mouth |
tsql { | |
driver = "slick.driver.MySQLDriver$" | |
db { | |
driver = "com.mysql.jdbc.Driver" | |
url = "jdbc:mysql://localhost:3306/test" | |
user = "root" | |
password = "pass" | |
} |
@annotation.tailrec | |
def findFileInParents(name: String, dir: File = file(".")): Option[File] = { | |
lazy val parent = Option(dir.getAbsoluteFile.getParentFile) | |
val f = dir / name | |
if (!f.exists) { | |
println(s"no $f. checking parent") | |
if (parent.isDefined) findFile(name, parent.get) | |
else None | |
} else Some(f) | |
} |
def path[A, B <: AnyRef](name: String, value: A, parent: B): FieldType[(name.type, parent.type), A] = | |
field[(name.type, parent.type)].apply[A](value) | |
def emptyPath[A](value: A): FieldType[Nothing, A] = field[Nothing](value) | |
trait Path[A] { | |
type Out <: HList | |
val value: Out |
I hereby claim:
To claim this, I am signing this object:
If you hate git submodule
, then you may want to give git subtree
a try.
When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add
command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.
When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.
Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this: