Skip to content

Instantly share code, notes, and snippets.

@kendagriff
kendagriff / solution.md
Created November 7, 2015 04:57
Solution to "OpenSSL::X509::StoreError: setting default path failed: Invalid keystore format" for JRuby

Solution to StoreError: invalid keystore format (OS X)

The following error appeared upon upgrading JRuby:

OpenSSL::X509::StoreError: setting default path failed: Invalid keystore format

Download cacert.pem

@kendagriff
kendagriff / while.clj
Last active September 9, 2015 14:31
while->
(defmacro while->
"As long as the predicate holds true, threads
the expr through each form (via `->`). Once pred returns
false, the current value of all forms is returned."
[pred expr & forms]
(let [g (gensym)
pstep (fn [step] `(if (~pred ~g) (-> ~g ~step) ~g))]
`(let [~g ~expr
~@(interleave (repeat g) (map pstep forms))]
~g)))
<!-- How about this?
This is super contrived. It's complex enough, however, to settle some of my concerns about Angular
(or any client-side framework). Basically, I want to see this with as little view logic as possible.
Overview:
A user is dropped into a two-step setup process: 1) account setup, and 2) spending categories setup.
When he completes those two steps, the group of accounts and group of categories should get moved to
a Home screen, where this little problem ends, but hypothetically he begins managing his finances.
@kendagriff
kendagriff / gist:4403257
Created December 28, 2012 23:54
Storing objects in an array, and then accessing them.
class IceCream
attr_reader :name
def initialize(name)
@name = name
end
end
vanilla = IceCream.new('Vanilla Ice Cream')
chocolate = IceCream.new('Chocolate Ice Cream')