Skip to content

Instantly share code, notes, and snippets.

View kapilreddy's full-sized avatar

Kapil Reddy kapilreddy

View GitHub Profile
@naiquevin
naiquevin / clj-fn-usages
Last active March 8, 2023 17:22
A crude way to find clojure functions usages in a codebase using ripgrep (false positives possible)
#!/usr/bin/env bash
## Script for searching for all references to a particular function in
## a clojure project (A crude implementation of "Find usage"
## functionality commonly found in IDEs such as Intellij) False
## positives are possible.
##
## Usage:
##
## $ clj-fn-usages NAMESPACE_QUALIFIED_FN [ paths ... ]
@reborg
reborg / rich-already-answered-that.md
Last active September 25, 2024 17:06
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

@cddr
cddr / compat-test.clj
Created July 12, 2016 07:59
Better than avro?
(s/def ::foo-1.0 (s/keys :req [::my-string ::my-int]))
(s/def ::foo-1.1 (s/keys :req [::my-string]))
(defspec compatability-test
(prop/for-all [v1-1 (s/gen ::foo-1.1)]
(s/valid? ::foo-1.0 v1-1)))
@nicokruger
nicokruger / jvm-heap-usage.sh
Created August 21, 2012 14:22
Getting java heap usage using jstat
jdk1.7.0/bin/jstat -gccapacity 9043 | tail -n 1 | awk '{ print $4, $5, $6, $10 }' | python -c "import sys; nums = [x.split(' ') for x in sys.stdin.readlines()]; print(str(sum([float(x) for x in nums[0]]) / 1024.0) + ' mb');"