Skip to content

Instantly share code, notes, and snippets.

View Douglas-Carneiro's full-sized avatar

Douglas Carneiro Douglas-Carneiro

View GitHub Profile
@usametov
usametov / recursive_splitter.clj
Created July 16, 2023 06:06
clojure implementation of LangChain's recursive splitter
(ns astanova.recursive-splitter
"implementation of LangChain's recursive code splitter"
(:require [clojure.string :as s]))
(defonce java-splitters [#"class " #"public " #"protected "
#"private " #"static " #"if"
#"for" #"while" #"switch"
#"case" #"\r\n" #"\t\t"])
(defonce js-splitters [#"function " #"const " #"let "
@ssrihari
ssrihari / clojure-learning-list.md
Last active September 25, 2024 10:44
An opinionated list of excellent Clojure learning materials

An opinionated list of excellent Clojure learning materials

These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.

  • 🔴 Mandatory (for both beginners and intermediates)
  • 🟩 For beginners
  • 🟨 For intermediates

Table of contents

  1. Getting into the language
@theronic
theronic / Dockerfile
Created May 30, 2022 16:23
Deploy Clojure to Fly.io: Efficient Multi-stage Docker build to Deploy Clojure Application to Fly.io
FROM clojure:openjdk-15-tools-deps AS builder
WORKDIR /opt
ADD deps.edn deps.edn
RUN clj -Sdeps '{:mvn/local-repo "./.m2/repository"}' -e "(prn \"Downloading deps\")"
RUN clj -e :ok
COPY . .
RUN clj -e :ok
(ns dnd.core
(:require
[reagent.core :as r]
[reagent.dom :as d]))
(def default-persons
[{:person/name "Kevin"
:person/age 29
:person/active? true}
{:person/name "Foo"
@kwrooijen
kwrooijen / threading.scm
Last active April 1, 2023 00:52
Clojure's threading macro in scheme
(define-syntax ->
(syntax-rules ()
([_ value]
value)
([_ value snd rest ...]
(cond
[(list? 'snd)
(let ([f (primitive-eval (car 'snd))]
[args (cons value (cdr 'snd))])
(-> (apply f args) rest ...))]