Skip to content

Instantly share code, notes, and snippets.

View jilen's full-sized avatar

jilen jilen

View GitHub Profile
@jilen
jilen / gist:6927632
Created October 11, 2013 00:04
ensime/win7/jdk1.7.15/emacs 24.3
Test inspect type at point.
.
...handling :connected
.
...handling :full-typecheck-finished
.
Test inspect type in range.
@jilen
jilen / native-memory-tracking
Created November 26, 2013 06:11
native memory tracking
Native Memory Tracking:
Total: reserved=454337KB, committed=397365KB
- Java Heap (reserved=313344KB, committed=313344KB)
(mmap: reserved=313344KB, committed=313344KB)
- Class (reserved=6186KB, committed=6186KB)
(classes #5856)
(malloc=6186KB, #8413)
@jilen
jilen / manage.scala.html
Last active January 2, 2016 11:19
Play template where web-mode not recongnize html tag firstly open
@(detail : AppDetail)
@main(title="控制台"){
<div id="content">
<div class="container">
<ul class="list-group">
<li class="list-group-item"><h4>@detail.app.name</h4></li>
<li class="list-group-item">
<span class="col-md-3">build时间
<span class="label label-warning">@detail.lastBuildTime.map(_.format("yyyy-MM-dd HH:mm:ss"))</span>
@jilen
jilen / gist:9050548
Created February 17, 2014 13:34
specs-error
> testOnly play.api.weibo.StatusesShowBatchSpec
[error] Could not create an instance of play.api.weibo.StatusesShowBatchSpec
[error] caused by java.lang.Exception: Could not instantiate class play.api.weibo.StatusesShowBatchSpec: null
[error] org.specs2.reflect.Classes$class.tryToCreateObjectEither(Classes.scala:93)
[error] org.specs2.reflect.Classes$.tryToCreateObjectEither(Classes.scala:211)
[error] org.specs2.specification.SpecificationStructure$$anonfun$createSpecificationEither$2.apply(BaseSpecification.scala:119)
[error] org.specs2.specification.SpecificationStructure$$anonfun$createSpecificationEither$2.apply(BaseSpecification.scala:119)
[error] scala.Option.getOrElse(Option.scala:120)
[error] org.specs2.specification.SpecificationStructure$.createSpecificationEither(BaseSpecification.scala:119)
[error] org.specs2.runner.SbtRunner.org$specs2$runner$SbtRunner$$specificationRun(SbtRunner.scala:73)
/**
* Takes a camel cased identifier name and returns an underscore separated
* name
*
* Example:
* camelToUnderscores("thisIsA1Test") == "this_is_a_1_test"
*/
def camelToUnderscores(name: String) = "[A-Z\\d]".r.replaceAllIn(name, {m =>
"_" + m.group(0).toLowerCase()
})
import com.ning.http.client._
import com.ning.http.client.cookie.Cookie
import scala.concurrent._
object http {
private val rng = new scala.util.Random
implicit class AhcClientOps(cli: AsyncHttpClient) {
def inSummaryPool(summaryName: String, summaryType: String) = ???
names.collect {
case namePattern(summaryName, summaryType) if inSummaryPool(summaryName, summaryType) =>
summaryPool(summaryName)
}
@(bb: String)
@foo(bar: String) = {
@for(i <- 1 to 10) {
<div>
<span>@i</span>
</div>
}
@if(bar == "bar") {
<div>@bar</div>
01-25 12:12:54.199 29565 29565 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.replaceAll(java.lang.String, java.lang.String)' on a null object reference
01-25 12:12:54.199 29565 29565 E AndroidRuntime: at com.a.a.a.b.l(SourceFile:86)
01-25 12:12:54.199 29565 29565 E AndroidRuntime: at com.a.a.a.b.bJ(SourceFile:81)
01-25 12:12:54.199 29565 29565 E AndroidRuntime: at com.android.messaging.ui.conversationlist.ConversationListItemView.a(SourceFile:405)
01-25 12:12:54.199 29565 29565 E AndroidRuntime: at com.android.messaging.ui.conversationlist.g.a(SourceFile:32)
01-25 12:12:54.199 29565 29565 E AndroidRuntime: at com.android.messaging.ui.C.onBindViewHolder(SourceFile:201)
01-25 12:12:54.199 29565 29565 E AndroidRuntime: at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(SourceFile:5277)
01-25 12:12:54.199 29565 29565 E AndroidRuntime: at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(SourceFile:5310)
01-2
case class Alarm(id: Option[Long] = None,
weixinId: String,
`type`: Int,
active: Boolean)