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
@clonekim
clonekim / db.clj
Created January 11, 2018 01:28
Honey SQL + CRUD Macro
(ns hub.db
(:require [clojure.tools.logging :as log]
[clojure.java.jdbc :as jdbc]
[mount.core :refer [defstate]]
[cheshire.core :refer [parse-string generate-string]]
[config.core :refer [env]]
[hub.util :as util]
[honeysql.core :as sql]
[honeysql.helpers :refer [merge-where]])
(:import [java.sql PreparedStatement]
@weavejester
weavejester / homoiconicity.md
Last active June 21, 2021 04:36
Homoiconicity in Clojure

Many programming languages are designed to favour writing code over writing literal data. For example, in Python the syntax for accessing an instance variable on an object is:

student.name

But to access a value in a dictionary data structure:

@jooyunghan
jooyunghan / monad-in-java.md
Last active November 17, 2023 04:54
한글번역 - Functor and monad examples in plain Java

Functor and monad examples in plain Java

이 글은 우리가 쓴 책, 'Reactive Programming with RxJava' 의 부록이었다. Reactive programming과 관련이 깊은 주제긴 하지만 모나드를 소개한다는 게 책과 썩 어울리지는 않았다. 그래서 나는 따로 블로그에 올리기로 했다. 프로그래밍을 다루는 블로그에서 *"반은 맞고 반은 틀릴 지 모르는 나만의 모나드 설명"*이란 것이 새로운 *"Hello World"*라는 점을 나도 잘 안다. 하지만 이 글은 펑터(functor)와 모나드(monad)를 자바 자료 구조와 라이브러리라는 각도에서 바라보고 있으며, 이는 공유할 정도의 가치는 있을거라 생각했다.

@devinabyss
devinabyss / angular_universal_korean.md
Last active January 1, 2019 10:42
Angular Universal (Angular 2 Server Rendering) 번역문

How Clojure Code Becomes a Running Program

Lisp, the original high-level language, introduced a long list of features common in languages today, including dynamic typing, interpretation, and garbage collection. The original Lisp language is long gone, but it had many imitators, which we call 'dialects' of Lisp. Clojure, introduced in 2007, is the first Lisp dialect to gain wide usage in three decades.

Though Lisp features have been co-opted by many other languages, what still distinguishes Lisp dialects from all other languages is how Lisp dialects translate source code into running programs. In non-Lisp languages, the code translation process has two primary steps:

  1. lexing (a.k.a. tokenization) and parsing
  2. code generation (compilation or interpretation)
@john2x
john2x / 00_destructuring.md
Last active June 6, 2024 13:40
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@ifesdjeen
ifesdjeen / ring_middleware_order.clj
Created May 1, 2013 20:23
Ring middleware execution order
(defn handler
[]
(println "HANDLER"))
(defn wrap-1
[handler]
(fn [request]
(println 1)
(handler request)