This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package frameless | |
import shapeless.Witness | |
class AmbiguousJoinTests extends TypedDatasetSuite { | |
def col[T, A](column: Witness.Lt[Symbol])( | |
implicit | |
exists: TypedColumn.Exists[T, column.T, A], | |
encoder: TypedEncoder[A]): TypedColumn[T, A] = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// doesn't print "release" unless you remove `.pipeIn(process1.id[A])`, | |
// internally `pipeIn` uses `takeWhile` which uses `pipe`, it breaks print too | |
def printSink[A] = io.stdOutLines.contramap[A](_.toString).pipeIn(process1.id[A]) | |
// simplier case doesn't work too: | |
// sink.lift[Task, A](x => Task.delay(())).pipe(process1.id[A => Task[Unit]]) | |
def disposableThing: Process[Task, Unit] = { | |
val acquire = Task.delay {println("acquire")} | |
val release = Task.delay {println("release")} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Data.HList | |
( (.:.) | |
, head | |
, tail | |
) where | |
newtype HList a = HList a | |
infixr 5 .:. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object SourceMap extends Controller { | |
implicit val ec = ExecutionContext.global | |
def at(prefix: String, path: String) = Action { | |
val fileOpt = Play.getExistingFile(s"../$prefix/" + path) | |
fileOpt.map { | |
case _ if !Play.isDev => Forbidden | |
case file if file.isDirectory => NotFound | |
case file if !file.exists() => NotFound |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in scala | |
// https://twitter.com/my7truth/status/269825587797958656 | |
// 79 | |
def p1(p: Seq[Int]) = p.zipWithIndex.map{case (x,y) => x * (p.size - y - 1)} dropRight 1 | |
// 86 | |
def p2(p: Seq[Int]) = p.zipWithIndex.map(x => x._1 * (p.size - x._2 - 1)) dropRight 1 | |
// 83 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// reply to http://worklez.name/blog/2012/07/18/java-named-parameters/ | |
class Request { } | |
class ManagerProvider { } | |
class Job { | |
Job(ManagerProvider provider, Request request, OutputStream out) { } | |
} | |
class JobBuilder { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:filetype plugin on | |
let g:C_AuthorName = 'Kanterov Gleb' | |
let g:C_AuthorRef = '' | |
let g:C_Email = '[email protected]' | |
let g:alternateNoDefaultAlternate = 1 | |
set sidescroll=5 | |
set listchars+=precedes:<,extends:> | |
set ignorecase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if exists("+showtabline") | |
function! MyTabLine() | |
let s = '' | |
let t = tabpagenr() | |
let i = 1 | |
while i <= tabpagenr('$') | |
let buflist = tabpagebuflist(i) | |
let winnr = tabpagewinnr(i) | |
let s .= (i != 1 ? '%#TabLine# | ' : '') | |
let s .= (i == t ? '%#TabLineSel#' : '%#TabLine#') |