Skip to content

Instantly share code, notes, and snippets.

View build.boot
(set-env!
:source-paths #{"src/cljs"}
:resource-paths #{"resources/public"}
:dependencies '[[org.clojure/clojure "1.8.0" :scope "test"]
[boot/core "2.5.1"]
[adzerk/boot-cljs "1.7.228-1" :scope "test"]
[adzerk/boot-cljs-repl "0.3.0" :scope "test"]
[com.cemerick/piggieback "0.2.1" :scope "test"]
[weasel "0.7.0" :scope "test"]
[org.clojure/tools.nrepl "0.2.12" :scope "test"]
View profile.boot
(require 'boot.repl)
(swap! boot.repl/*default-dependencies* conj
'[refactor-nrepl "2.0.0-SNAPSHOT"]
'[org.clojure/tools.nrepl "0.2.12"]
'[cider/cider-nrepl "0.11.0-SNAPSHOT"])
(swap! boot.repl/*default-middleware*
conj 'cider.nrepl/cider-middleware)
View StreamExamples.scala
package org.examples
object StreamExamples {
// group List(1,1,2,2,2,3,4,4) =>
// List(List(1,1), List(2,2,2), List(3), List(4,4))
def group[A](s: Stream[A]): Stream[List[A]] =
s match {
case Stream() => Stream.empty
case hd #:: tl =>
View zip.scala
// zip3 Lists
object ZipUtils {
def zip3[A, B, C] (xs: List[A], ys: List[B], zs: List[C]) : List[(A, B, C)] = {
def zip3_aux(xs: List[A], ys: List[B], zs: List[C],
acc: List[(A, B, C)]) : List[(A, B, C)] = (xs, ys, zs) match {
case (xh :: xt, yh :: yt, zh :: zt) => zip3_aux (xt, yt, zt, (xh, yh, zh) :: acc )
case _ => acc.reverse
}
zip3_aux(xs, ys, zs, Nil)
}
View gitconfig
[push]
default = simple
[color]
ui = true
[color "branch"]
current = yellow ul
local = cyan bold
remote = magenta
View gist:5974
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
#
# unmerged: README
# modified: README
# unmerged: app/controllers/application.rb
# modified: app/controllers/application.rb
# unmerged: config/boot.rb
# modified: config/boot.rb
# unmerged: config/database.yml