I hereby claim:
- I am dchelimsky on github.
- I am dchelimsky (https://keybase.io/dchelimsky) on keybase.
- I have a public key ASB3AiFZ1XwvHdnlZ8iycD-sWJxNiNTnP0P9QAtUD03Hngo
To claim this, I am signing this object:
(ns exercise-specs | |
(:require [clojure.test :as t :refer [deftest is]] | |
[clojure.string :as str] | |
[clojure.spec.alpha :as s] | |
[clojure.tools.namespace.find :as namespace.find] | |
[clojure.tools.namespace.parse :as namespace.parse] | |
[clojure.java.io :as io]) | |
(:import (java.io PushbackReader))) | |
(def ^:dynamic *num-tests* 10) |
I hereby claim:
To claim this, I am signing this object:
diff --git a/src/semantic_csv/core.clj b/src/semantic_csv/core.clj | |
index bfb3972..6f780cb 100644 | |
--- a/src/semantic_csv/core.clj | |
+++ b/src/semantic_csv/core.clj | |
@@ -213,6 +213,19 @@ | |
;; pipeline. | |
+;; input - lazy seq of rows | |
+;; out - map of col-names to casting-fns |
(ns multi-arity-v-varargs.core | |
(:require [criterium.core :refer [quick-bench]]) | |
(:gen-class)) | |
(defn varargs [arg1 & [arg2 arg3]] | |
42) | |
(defn multi-arity | |
([arg1] 42) | |
([arg1 arg2] 42) |
DateTime.new(2014,1,2,3,4,5.678).strftime("%L") | |
# => "678" | |
Time.new(2014,1,2,3,4,5.678).strftime("%L") | |
# => "677" |
(defn chainable? | |
([words] | |
((complement not-any?) #(chainable? % (clojure.set/difference words %)) words)) | |
([word others] | |
(letfn [(levenshtein [str1 str2] | |
(cond (empty? str1) (count str2) | |
(empty? str2) (count str1) | |
:else | |
(let [cost (if (= (first str1) (first str2)) 0 1)] | |
(min (inc (levenshtein (rest str1) str2)) |
require 'wrong/adapters/rspec' | |
# (apply comp fns) in clojure | |
module Composer | |
def compose((*rest, last)) | |
last ||= ->(x){x} | |
rest_reversed = rest.reverse_each | |
lambda do |*args| |
class RSpec::Core::ExampleGroup | |
class << self | |
alias it describe | |
alias wrapped_example example | |
def example(&block) | |
wrapped_example { assert &block } | |
end | |
end | |
end |
describe Task::RestartProcesses do | |
describe '#run_with_error' do | |
let(:client) { double('HerokuClient').as_null_object } | |
let(:logger) { double('Logger').as_null_ojbect } | |
let(:task) { Task::RestartProcesses.new logger: logger } | |
before do | |
# Inject Dependencies | |
task.client = client |
2.0.0-p0 :002 > require 'date' | |
=> true | |
2.0.0-p0 :003 > DateTime.parse('2013-01-01') == '2013-01-01' | |
=> false | |
2.0.0-p0 :004 > require 'active_support/core_ext.rb' | |
=> true | |
2.0.0-p0 :005 > DateTime.parse('2013-01-01') == '2013-01-01' | |
=> true |