Skip to content

Instantly share code, notes, and snippets.

View ivanpierre's full-sized avatar
😥
A little ill for some time... but work still in progress as possible... ;)

Ivan Pierre ivanpierre

😥
A little ill for some time... but work still in progress as possible... ;)
View GitHub Profile
@just-sultanov
just-sultanov / bb.edn
Last active January 8, 2022 18:18
Typical project tasks using babashka
{:min-bb-version "0.6.1"
:tasks
{:requires ([babashka.fs :as fs]
[babashka.process :as proc]
[clojure.string :as str]
[clojure.pprint :as pprint])
;; Helpers
@matthewdowney
matthewdowney / client-encrypt.clj
Last active May 17, 2020 20:46
Lightweight key management with client-side encryption in Clojure applications.
(ns client-encrypt
"Utilities to for encrypting credentials (chiefly API keys),
storing them on disk, and editing them."
(:require [buddy.core.codecs :as codecs]
[buddy.core.nonce :as nonce]
[buddy.core.crypto :as crypto]
[buddy.core.kdf :as kdf]
[clojure.java.io :as io]
[clojure.java.shell :as sh]
[clojure.pprint :as pprint]
@shapiy
shapiy / quintessence.clj
Last active May 7, 2020 07:34
A higher-order function to yield some sense in an arbitrary life situation, no matter how absurd, written in Clojure.
(defn quintessence
"Yields sense.
Should be used judiciously. Sense is not what you always want."
[]
(fn [anything] ((juxt :important :inevitable) anything)))
@reborg
reborg / conference-radar.md
Last active January 28, 2019 17:56
Conference Radar
@borkdude
borkdude / README.md
Last active June 4, 2022 02:26
CLI app with ClojureScript on Node

First install clojure so the clj command will be available.

brew install clojure

Clone and move core.cljs to the right directory:

git clone https://gist.github.com/a6427534ea76cd4e9222a76eb398b289.git inc
cd inc
@cgrand
cgrand / shootout.md
Created November 24, 2017 18:01
Pretty printers compared

clojure.pprint

=> (binding [clojure.pprint/*print-right-margin* 30]
     (clojure.pprint/pprint {:a :b :c {:e :f :g :h :i :j :k :l} :m :n :o {:p {:q :r :s :t}}}))
{:a :b,
 :c
 {:e :f,
  :g :h,
  :i :j,
 :k :l},
@tooky
tooky / bumbailiff
Created September 18, 2017 14:53
Bumbailiff - A script for ageing TODO comments in code.
#!/usr/bin/env bash
#
# The bumbailiff allows the team to take up a small amount of technical debt
# (TODOs in the code) for a limited period. After that period the script fails.
#
# It will find // TODO in .js or .jsx files, and # TODO in .feature files.
#
# For example, if the allowed period for all the TODOs is 14 days.
# * It's OK to have 1 TODO that is 13 days old
# * It's OK to have 3 TODOs that are 4 days old
@reborg
reborg / rich-already-answered-that.md
Last active July 3, 2024 06:35
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@cemerick
cemerick / foo.clj
Last active March 9, 2017 12:20
slightly saner printing for Clojure fns
(defn delegate-printing-for
"Registers the necessary methods to delegate printing of instances of [class] to [fn]."
[class fn]
#?@(:clj [(defmethod print-method class
[x writer]
(.write ^java.io.Writer writer (fn x)))
(defmethod print-dup class
[x writer]
(print-method x writer))
(#'clojure.pprint/use-method
@reborg
reborg / most-used-fns.clj
Last active January 28, 2019 11:02
Clojure functions usage frequencies
;; The list of (almost) all Clojure public functions and macros ordered by usage. Source: Github code search for Clojure repositories.
(["ns" 394490]
["defn" 293918]
["require" 279210]
["let" 237654]
["def" 172983]
["refer" 163654]
["map" 159781]
["fn" 154482]