Skip to content

Instantly share code, notes, and snippets.

View whysoserious's full-sized avatar
💭
Making things work

Jan Ziniewicz whysoserious

💭
Making things work
View GitHub Profile
;; to sie dlawi przy wiekszej liscie albo wektorze
(defn buildlist [x acc]
(if (= x 0) acc
(buildlist (dec x) (cons x acc))))
;; to dziala ok
(defn buildlist2 [x acc]
(if (= x 0) acc
(recur (dec x) (cons x acc))))
(ns prop-test.core
(:require [clojure.test.check :as tc]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop]
[cheshire.core :as json]))
(def key-gen
(gen/such-that not-empty gen/string-alphanumeric))
(def value-any (gen/one-of [gen/string-alphanumeric gen/boolean gen/int]))
Starting nREPL server via lein repl :headless...
Contacting host: melpa.milkbox.net:80
Quit
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Retrieving cider/cider-nrepl/0.9.0-SNAPSHOT/cider-nrepl-0.9.0-20150413.143741-24.pom from clojars
Retrieving compliment/compliment/0.2.1-SNAPSHOT/compliment-0.2.1-20150306.111224-5.pom from clojars
Retrieving defprecated/defprecated/0.1.1/defprecated-0.1.1.pom from clojars
Retrieving cljs-tooling/cljs-tooling/0.1.5-SNAPSHOT/cljs-tooling-0.1.5-20150313.183918-2.pom from clojars
Retrieving debugger/debugger/0.1.7/debugger-0.1.7.pom from clojars
Retrieving cljfmt/cljfmt/0.1.10/cljfmt-0.1.10.pom from clojars
@whysoserious
whysoserious / whatever.scala
Created January 17, 2015 13:59
no-more-actors
actorRef ! "whatever"
-- 1. Create 'schema' ;)
create tablespace test_user_ts
datafile 'test_user_tabspace.dat'
size 10M reuse
autoextend on next 500K;
create temporary tablespace test_user_ts_tmp
tempfile 'test_user.tabspace_temp.dat'
size 10M reuse
import akka.actor._
import akka.util.ByteString
import spray.http.HttpEntity.Empty
import spray.http.MediaTypes._
import spray.http._
import spray.routing.{HttpService, RequestContext, SimpleRoutingApp}
object ChunkedSpray extends App with SimpleRoutingApp {
import StreamingActor._
import akka.actor._
import akka.util.ByteString
import spray.http.HttpEntity.Empty
import spray.http.MediaTypes._
import spray.http._
import spray.routing.{HttpService, RequestContext, SimpleRoutingApp}
object StreamingActor {
// helper methods
@whysoserious
whysoserious / ExampleApp.scala
Last active August 29, 2015 14:09
Chunked responses from spray.io server
import akka.actor._
import akka.util.ByteString
import spray.http.HttpEntity.Empty
import spray.http.MediaTypes._
import spray.http._
import spray.routing.{HttpService, RequestContext, SimpleRoutingApp}
object ChunkedSpray extends App with SimpleRoutingApp {
import StreamingActor._
@whysoserious
whysoserious / recognize-mime.scala
Created November 13, 2014 15:52
Recognize MIME
import spray.http.MediaType
import spray.http.MediaTypes._
/**
* Recognize MediaType based on file name
* @return MediaType
*/
def mimeType: String => MediaType = {
lazy val ExtensionRegex = """^.*\.(.*)$""".r
-J-Xmx4G
-J-XX:+UseConcMarkSweepGC
-J-XX:+CMSClassUnloadingEnabled
-J-Xss2M -Duser.timezone=GMT
-jvm-debug 5008