Skip to content

Instantly share code, notes, and snippets.

import scala.concurrent._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
object Futs {
def stuff() = {
val fut1 = Future {
println("future 1")
1
}
decimal ₹ ls
decimal.fr
decimal ₹ fregel
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
Welcome to Frege 3.23.370-g898bc8c (Oracle Corporation Java HotSpot(TM) 64-Bit Server VM, 1.8.0_60)
frege> :l decimal.fr
Module Decimal
frege> main []
user=> (def stuff (atom []))
#'user/stuff
user=> (swap! stuff merge 1)
[1]
user=> @stuff
[1]
user=> (future (do (Thread/sleep 5000) (reset! stuff [])))
#object[clojure.core$future_call$reify__6736 0x12f0293 {:status :pending, :val nil}]
user=> @stuff
[1]
(defproject clj-slackbot "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:min-lein-version "2.0.0"
:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/core.async "0.1.346.0-17112a-alpha"]
[compojure "1.4.0"]
[clojail "1.0.6"]
[clj-http "2.0.0"]
[cheshire "5.5.0"]
cabal: Could not resolve dependencies:
trying: Snowdrift-0.1.4 (user goal)
trying: yesod-static-1.5.0 (dependency of Snowdrift-0.1.4)
trying: conduit-extra-1.1.9 (dependency of yesod-static-1.5.0)
trying: monad-control-1.0.0.4 (dependency of conduit-extra-1.1.9)
trying: yesod-markdown-0.9.4 (dependency of Snowdrift-0.1.4)
trying: texmath-0.8.2 (dependency of yesod-markdown-0.9.4)
trying: pandoc-types-1.12.4.3 (dependency of texmath-0.8.2)
trying: aeson-0.9.0.1 (dependency of pandoc-types-1.12.4.3)
trying: yesod-form-1.4.4.1 (dependency of Snowdrift-0.1.4)
#!/bin/bash
#
# Requires ftxdumperfuser from http://developer.apple.com/textfonts/download/
#
# Usage: fixconsolas [files ...]
# When called with no arguments, it attempts to operate on every TrueType
# file in the current directory.
#
# References:
# http://bandes-storch.net/blog/2008/12/21/consolas-controlled/#comment-2042
package pc
import akka.actor.Actor
import akka.actor.Props
import akka.actor.ActorRef
import akka.actor.ActorRefFactory
class Parent extends Actor {
val child = context.actorOf(Props[Child], "child")
var ponged = false
@vijaykiran
vijaykiran / Perhaps.hs
Created November 13, 2013 14:35
Getting a hang of Haskell Types
data Perhaps a = Nil | Only a
instance (Eq a) => Eq (Perhaps a) where
Only x == Only y = x == y
Nil == Nil = True
instance (Show a) => Show (Perhaps a) where
show Nil = "Nil is Nothing"
show (Only x) = " It is Only " ++ show x
myLength1 :: [a] -> Int
myLength1 [] = 0
myLength1 (x:[]) = 1
myLength1 (x:xs) = myLength1 xs + 1
-- why ?
myLength2 :: (Eq t, Num a) => [t] -> a
myLength2 (x:xs) | xs == [] = 1
(defadvice split-window-vertically (around vk-select-other)
(print "test"))
(ad-activate 'split-window-vertically)