Skip to content

Instantly share code, notes, and snippets.

View autumn-n's full-sized avatar
๐Ÿ 
Working from home

Autumn autumn-n

๐Ÿ 
Working from home
View GitHub Profile
@autumn-n
autumn-n / data-modeling.md
Created January 1, 2025 10:49 — forked from levand/data-modeling.md
Advice about data modeling in Clojure

Since it has come up a few times, I thought Iโ€™d write up some of the basic ideas around domain modeling in Clojure, and how they relate to keyword names and Specs. Firmly grasping these concepts will help us all write code that is simpler, cleaner, and easier to understand.

Clojure is a data-oriented language: weโ€™re all familiar with maps, vectors, sets, keywords, etc. However, while data is good, not all data is equally good. Itโ€™s still possible to write โ€œbadโ€ data in Clojure.

โ€œGoodโ€ data is well defined and easy to read; there is never any ambiguity about what a given data structure represents. Messy data has inconsistent structure, and overloaded keys that can mean different things in different contexts. Good data represents domain entities and a logical model; bad data represents whatever was convenient for the programmer at a given moment. Good data stands on its own, and can be reasoned about without any other knowledge of the codebase; bad data is deeply and tightly coupled to specific generating and

ํ•œ๊ธ€๊ณผ ์œ ๋‹ˆ์ฝ”๋“œ

์œ ๋‹ˆ์ฝ”๋“œ์—์„œ ํ•œ๊ธ€์„ ์–ด๋–ป๊ฒŒ ๋‹ค๋ฃจ๋Š”์ง€๋ฅผ ์ •๋ฆฌํ•˜์˜€๋‹ค.

์œ ๋‹ˆ์ฝ”๋“œ

  • ์œ ๋‹ˆ์ฝ”๋“œ(Unicode)๋Š” ์ „ ์„ธ๊ณ„์˜ ๋ชจ๋“  ๋ฌธ์ž๋ฅผ ์ปดํ“จํ„ฐ์—์„œ ์ผ๊ด€๋˜๊ฒŒ ํ‘œํ˜„ํ•˜๊ณ  ๋‹ค๋ฃฐ ์ˆ˜ ์žˆ๋„๋ก ์„ค๊ณ„๋œ ์‚ฐ์—… ํ‘œ์ค€ (์œ„ํ‚ค ๋ฐฑ๊ณผ)
  • ๋‹จ์ˆœํžˆ ๋ฌธ์ž๋งˆ๋‹ค ๋ฒˆํ˜ธ๋ฅผ ๋ถ™์ž„
  • ๊ณ„์† ์—…๋ฐ์ดํŠธ๋˜๋ฉฐ ํ˜„์žฌ๋Š” Unicode Version 9.0.0 ์ด ์ตœ์‹ ์ด๋‹ค.

UTF

  • ์œ ๋‹ˆ์ฝ”๋“œ๋ฅผ ์‹ค์ œ ํŒŒ์ผ ๋“ฑ์— ์–ด๋–ป๊ฒŒ ๊ธฐ๋กํ•  ๊ฒƒ์ธ์ง€๋ฅผ ํ‘œ์ค€ํ™”ํ•œ ๊ฒƒ์ด๋‹ค.
@autumn-n
autumn-n / core.clj
Created February 23, 2019 13:10 — forked from dfcarpenter/core.clj
Domain Modelling using Clojure
(comment "This is a small experiment inspired by Oskar Wickstrรถms
excellent work at
https://haskell-at-work.com/episodes/2018-01-19-domain-modelling-with-haskell-data-structures.html.
I wanted to see what would be involved in building the equivalent
functionality in reasonably ideomatic Clojure. It is also my first
from scratch use of Clojure spec, which was a very interesting and
productive experience. It is amazing how little work one has to do
to be able to generate example datastructures for testing. The
generated examples helped me find a subtle bug in the tree pretty
printer, that would have been hard to find without." "I would love
@autumn-n
autumn-n / ring_middleware_order.clj
Created September 6, 2018 01:50 — forked from ifesdjeen/ring_middleware_order.clj
Ring middleware execution order
(defn handler
[handler]
(println "HANDLER"))
(defn wrap-1
[handler]
(fn [request]
(println "pre-1")
(handler request)
(println "post-1")))
@autumn-n
autumn-n / .gitlab-ci.yml
Created September 1, 2018 15:21
Configuration of .gitlab-ci.yml for newman (docker)
variables:
POSTMAN_COLLECTION: https://api.getpostman.com/collections/${c_uid}?apikey=${apiKey}
POSTMAN_ENVIRONMENT: https://api.getpostman.com/environments/${e_uid}?apikey=${apiKey}
stages:
- some_stages
- postman
postman_job:
stage: postman
@autumn-n
autumn-n / .gitlab-ci.yml
Created September 1, 2018 15:20
Configuration of .gitlab-ci.yml for newman (without docker)
variables:
POSTMAN_COLLECTION: https://api.getpostman.com/collections/${c_uid}?apikey=${apiKey}
POSTMAN_ENVIRONMENT: https://api.getpostman.com/environments/${e_uid}?apikey=${apiKey}
stages:
- some_stages
- postman
postman_job:
stage: postman