Skip to content

Instantly share code, notes, and snippets.

View gist:69c50ace9a5d888c9a48
[info] Starting scala interpreter...
Welcome to Scala version 2.10.4 (OpenJDK 64-Bit Server VM, Java 1.6.0_32).
Type in expressions to have them evaluated.
Type :help for more information.
scala> def f = 1
def f = 1
f: Int
jackrusher / fold-and-spindle.clj
Last active Aug 29, 2015
A few words on fold for a friend who had just read
View fold-and-spindle.clj
;; simplest fold definition
(defn fold [f init l]
(if (empty? l) init (fold f (f init (first l)) (rest l))))
;; by this time you are almost certainly comfortable with signatures like:
;; Int -> Int
(fold + 0 [1 2 3 4 5])
;; => 15
View tree.go
package main
import (
type Tree struct {
Children []*Tree
jordanorelli / templates.go
Created Aug 9, 2012
primitive template cache in Go with os.Stat
View templates.go
package core
import (
View gist:4262177
#lang r5rs
(define-syntax var
(syntax-rules ()
((_ x) (vector x))))
(define-syntax var?
(syntax-rules ()
((_ x) (vector? x))))

Auto Synchronized Backups with Bittorrent sync & a vps

1. Cloud syncing on the cheap

Two awsome things were released yesterday :

Compare this to the pricing of : dropbox pro

View radical.cljs
(ns async-test.core
(:require [cljs.core.async :refer [chan]]
[clojure.string :as string])
[cljs.core.async.macros :as m :refer [go alt! alts!]]))
(def c (chan))
(def loc-div (.getElementById js/document "location"))
(.addEventListener js/window "mousemove"
View client.cljs
(def cds (collection))
;; interact with database
(>! (:in cds)
{:op :create
:val {:title "Soft Machine Vol. 1"
:artist "Soft Machine"
:year 1969}})
anonymous / ux.cljs
Created Jan 21, 2014
View ux.cljs
;;; TODO - drag-enter and -exit events : Right now, a component doesn't receive events for other components
;;; If a component responds to drag-over, it won't "revert" state until the drag ends.
;; NOTE - compiles with om 0.1.7. Needs updating to 0.2+
(ns omdnd.ux
[cljs.core.async.macros :refer [go alt!]]
View core.cljs
(ns react-cljs.core
(:require React))
(declare render)
(defn handle-change [e]
(render {:text (.. e -target -value)}))
(defn render [{:keys [text]}]