I hereby claim:
- I am algal on github.
- I am alexisgallagher (https://keybase.io/alexisgallagher) on keybase.
- I have a public key whose fingerprint is 3E64 F42E 2405 40EA 98E1 8AFB 60F4 2CDB DF42 F063
To claim this, I am signing this object:
#!/usr/bin/env boot | |
;; needs boot-clj | |
;; converts edn to json, | |
;; - taking #inst to strings of ISO8601 timestamps | |
;; - taking #uuid to strings | |
(set-env! :dependencies '[[org.clojure/data.json "0.2.6"]]) | |
(require '[clojure.data.json :as json]) |
http://docs.datomic.com/pull.html | |
https://github.com/tonsky/datascript | |
https://github.com/brandonbloom/jsgraphthinggie | |
https://github.com/juxt/pull/ | |
https://github.com/alandipert/intension |
#!/usr/bin/env boot | |
;; needs boot-clj | |
(set-env! :dependencies '[[org.clojure/data.csv "0.1.3"] | |
[org.clojure/data.json "0.2.6"]]) | |
(require '[clojure.data.csv :as csv]) | |
(require '[clojure.data.json :as json]) | |
(defn run [in out] | |
(let [data (json/read in) |
I hereby claim:
To claim this, I am signing this object:
// Paste me into a playground and then do Editor / Show Rendedered Markup | |
import UIKit | |
/*: | |
Swift defines `IntervalType`, a protocol with associated type (PAT) with one associated type `Bound` | |
This PAT is adopted by two interval types, `ClosedInterval` and `HalfOpenInterval` |
/// An `OutputStreamType` which uses GCD to write to a file | |
class FileOutputStream : OutputStreamType | |
{ | |
private let filepath:NSURL | |
private let channel:dispatch_io_t! | |
/** | |
Initializes output stream to write to `filename` in the user's Documents directory. | |
*/ |
/// seconds from the reference date to the system's last restart | |
private let secondsFromReferenceDateToRestart:NSTimeInterval = { | |
/* we pretend these next two statements take place atomically, although in fact they do not, and the fact that clock progresses between the two statements will introduce miniscule error into our calculation */ | |
let secondsFromSystemRestartToInit = NSProcessInfo().systemUptime | |
let secondsFromReferenceDateToInit = NSDate.timeIntervalSinceReferenceDate() | |
let retVal = secondsFromReferenceDateToInit - secondsFromSystemRestartToInit | |
return retVal | |
}() | |
extension NSDate { |
// known confusing on Swift 2.1, Xcode 7.1 | |
import Foundation | |
public class InnerMutator { | |
var f:(() -> Void)? | |
} | |
public struct MutableValue | |
{ |
/// Exposes all colors in a gradient, which is defined as usual by a finite number of color stops | |
/// - version: known good on Xcode 7.1 playgrounds and iOS 9.1 | |
class ColorGradient | |
{ | |
// array of specified colors for specified locations along the gradient | |
let colors:[UIColor] | |
// array of specified locations (in 0...1) for the specified colors in the gradient | |
let locations:[CGFloat] | |
let gradientImage:UIImage |
/// Given `path`, drawn with `width`, returns a new path outlining its edges | |
func pathOutliningPath(path:UIBezierPath, withWidth width:CGFloat, inSize size:CGSize) -> UIBezierPath | |
{ | |
UIGraphicsBeginImageContextWithOptions(size, false, 0) | |
let ctx = UIGraphicsGetCurrentContext() | |
CGContextSetLineWidth(ctx, width) | |
CGContextAddPath(ctx, path.CGPath) | |
CGContextReplacePathWithStrokedPath(ctx) | |
let extractedCGPath = CGContextCopyPath(ctx) | |
UIGraphicsEndImageContext() |