Skip to content

Instantly share code, notes, and snippets.

View arohner's full-sized avatar

Allen Rohner arohner

View GitHub Profile
@arohner
arohner / gist:9836337
Created March 28, 2014 16:05
core.typed bug?
(ns circle.scratch
(:require [clojure.core.typed :as t]))
(t/ann foo [t/Int -> Boolean])
(defn foo [x]
true)
(t/ann bar [& :optional {x t/Int} -> Boolean])
(defn bar [& {:keys [x]
:or {x 3}}]
@arohner
arohner / gist:9902017
Created March 31, 2014 20:54
break `lein deps :tree`
(defproject broken-clj-webdriver "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[clj-webdriver "0.6.0"]
[clj-webdriver "0.6.0-beta2"]])
// BMOEDNSymbol.h
#import <Foundation/Foundation.h>
@interface BMOEDNSymbol : NSObject <NSCopying>
@property (strong, nonatomic, readonly) NSString *ns;
@property (strong, nonatomic, readonly) NSString *name;
-(instancetype)initWithNamespace:(NSString *)ns
class func a(bar:Bar!, bbq:BBQ!)
{
}
class func b(c:(Bar!, BBQ!) = a)
{
}
;;(Bar!, BBQ!) -> () is not convertible to (Bar!, BBQ!)
class Test : NSWindowController {
var foo: String
init(window:NSWindow!)
{
self.foo = "foo"
super.init(window:window)
}
init(coder:NSCoder!)
{
class MemoryLeaker
{
func leakOne()
{
// let event = EventKeyboard.MR_createEntity() as EventKeyboard!
let context = NSManagedObjectContext.MR_contextForCurrentThread()
let entityname = NSStringFromClass(EventKeyboard)
let event = NSEntityDescription.insertNewObjectForEntityForName(entityname, inManagedObjectContext:context) as EventKeyboard
event.MR_deleteEntity();
}
@arohner
arohner / gist:72ee3fe38586c98c4df7
Created August 11, 2014 16:36
data.xml failures
Testing clojure.data.xml.test-emit
FAIL in (test-indent-str) (test_emit.clj:123)
expected: (= expect (indent-str nested-xml))
actual: (not (= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<a>\n <b>\n <c>\n <d>foo</d>\n </c>\n </b>\n</a>\n" "<?xml version=\"1.0\" encoding=\"UTF-8\"?><a>\n <b>\n <c>\n <d>foo</d>\n </c>\n </b>\n</a>\n"))
FAIL in (test-indent) (test_emit.clj:131)
expected: (= expect (.toString sw))
actual: (not (= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<a>\n <b>\n <c>\n <d>foo</d>\n </c>\n </b>\n</a>\n" "<?xml version=\"1.0\" encoding=\"UTF-8\"?><a>\n <b>\n <c>\n <d>foo</d>\n </c>\n </b>\n</a>\n"))
@arohner
arohner / gist:8380b59a839c0ec23058
Created September 15, 2014 21:32
datomic into {}
Type Error (flowmeter/util/datomic.clj:29:3) Polymorphic function into could not be applied to arguments:
Polymorphic Variables:
x
y
Domains:
(t/Map x y) (t/U nil (Seqable (t/U nil (IMapEntry x y) (t/HVec [x y]) (Seqable (clojure.lang.IMapEntry x y)))))
(t/Vec x) (t/U nil (Seqable x))
(t/Set x) (t/U nil (Seqable x))
(t/Coll t/Any) (t/U nil (Seqable t/Any))
(->> keyseq
(map (fn [k]
(let [local (-> k name symbol)]
`[~k ~local])))
(into {}))
@arohner
arohner / gist:566f7811ce30dd295b51
Created September 29, 2014 22:25
working with CFArray
public class LaunchAtStartup : NSObject
{
public class func enumerateLaunchItems()
{
let loginItemsRef = LSSharedFileListCreate(nil, kLSSharedFileListSessionLoginItems.takeUnretainedValue(), nil).takeUnretainedValue()
var itemUrl:NSURL?