April 18th, 2017 AWS, googlefood, Shell Scripting
A tiny shell script for listing the AWS IAM permission for a particular system, like “ec2” or “s3”.
Does not handle every possible case, as some URL paths are inconsistent. YMMV.
Example:
lap ~> iam-permissions ec2 | head -5
ec2:AcceptReservedInstancesExchangeQuote
ec2:AcceptVpcPeeringConnection
ec2:AllocateAddress
ec2:AllocateHosts
ec2:AssignPrivateIpAddresses
Script below…
Read the rest of this entry »
April 12th, 2017 Clojure
Not being able to figure this out is what killed all my previous attempts to use Datomic.
You want to transact two Entities that have a relationship between them. You’ve tried all the different variations that Google shows you, but they all give you :db.error/not-an-entity
What you want is the TWO ARGUMENT version of #db/id
|
@(d/transact conn [ {:db/id #db/id[:db.part/user -1] :name "Verna M" } {:db/id #db/id[:db.part/user] :name "Darren Holloway" :mother #db/id[:db.part user -1] }]) |
Here, Verna gets a Temporary ID of -1 in this transaction. We can then reference that same Temporary ID later under :mother
This of course assumes that you have a Schema that defines :mother as a Datomic Reference, such as:
|
@(d/transact conn [ {:db/ident :parent :db/doc "Reference to Mother" :db/cardinality :db.cardinality/one :db/valueType :db.type/ref :db/id #db/id[:db.part/db] :db.install/_attribute :db.part/db }]) |
Also note that #db/id is simply a Tagged Element (similar to a reader macro), not an inline function or symbol reference or anything else.
April 11th, 2017 Clojure, googlefood
Stuart Sierra’s Component library for Clojure took awhile for me to really understand. Hence these notes.
Read the rest of this entry »
January 28th, 2017 Clojure, googlefood
When you use the lein plugin luminus to create a web application based on the Luminus Web Stack, it creates three directories under src: clj, cljs, and cljc.
What are these for?
Read the rest of this entry »
November 16th, 2016 googlefood
There’s lots of different things that can cause this error. The one that I was hitting was rather unintuitive.
Read the rest of this entry »