Skip to content

Instantly share code, notes, and snippets.

@bguthrie
bguthrie / typed.clj
Last active September 17, 2015 16:15
An attempt to strongly-type an XML search function.
(ns xml.typed
(:require [clojure.xml :as xml]
[clojure.core.typed :as t])
(:import (clojure.lang Keyword)))
(t/defalias XmlNodeContent (t/U String XmlNode))
(t/defalias XmlNode
(t/HMap :mandatory {:tag Keyword
:content (t/ASeq XmlNodeContent)}
(ns clue.core
(:require [clj-http.client :as http]
[clojure.spec :as s]))
(def client-key (System/getProperty "HUE_CLIENT_KEY"))
(def hue-api (System/getProperty "HUE_SERVER_ADDRESS"))
(def base-url (str "http://" hue-api "/api/" client-key))
(s/def :light/name (s/nilable string?))
describe SomeClass do
describe '#some_method' do
def actual(parameter)
described_class.some_method(parameter)
end
it 'expresses behavior 1' do
expect(
actual('base_value')
).to eq('expected 1')
@bguthrie
bguthrie / LICENSE.txt
Last active May 21, 2021 15:30
TS typings for imagekit-react
Copyright 2021 BRIAN GUTHRIE
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTH