Skip to content

Instantly share code, notes, and snippets.

View arichiardi's full-sized avatar

Andrea Richiardi arichiardi

  • Canada
  • 00:17 (UTC -06:00)
View GitHub Profile
@adham-omran
adham-omran / prompt.md
Created January 23, 2025 06:28
Clojure Documentation LLM Prompt

You are an expert Clojure developer with 15 years of experience, write a rich docstring for the provided function form using the following guidelines

  • Let the first line in the docstring be a complete, capitalized sentence which concisely describes the var in question. This makes it easy for tooling (Clojure editors and IDEs) to display a short a summary of the docstring at various places.
  • Document all positional arguments, and wrap them them with backticks () so that editors and IDEs can identify them and potentially provide extra functionality for them.
  • Wrap any var references in the docstring with so that tooling can identify them. Wrap them with [[..]] if you want to link to them
  • Docstrings should be composed of well-formed English sentences. Every sentence should start with a capitalized word, be grammatically coherent, and end with appropriate punctuation. Sentences should be separated with a single space.
  • Indent multi-line docstrings by two spaces.
  • Neither start nor end your docstrings
@chase-lambert
chase-lambert / onefile.clj
Created January 16, 2025 01:56
Concatenates all your git repo's clojure files into one file
#!/usr/bin/env bb
;; A Babashka script to concatenate all Clojure files in a repository into a single file.
;; Respects .gitignore patterns and includes clear file separation markers.
;;
;; Usage:
;; ./onefile.clj ; uses current git repo and default output
;; ./onefile.clj /path/to/repo ; uses custom repo path
;; ./onefile.clj /path/to/repo out.clj ; specifies output filename
;;
@Artefact2
Artefact2 / README.md
Last active July 1, 2025 16:29
GGUF quantizations overview
@padeoe
padeoe / README_hfd.md
Last active July 1, 2025 08:15
CLI-Tool for download Huggingface models and datasets with aria2/wget: hfd

🤗Huggingface Model Downloader

Note

(2025-01-08) Add feature for 🏷️Tag(Revision) Selection, contributed by @Bamboo-D.
(2024-12-17) Add feature for ⚡Quick Startup and ⏭️Fast Resume, enabling skipping of downloaded files, while removing the git clone dependency to accelerate file list retrieval.

Considering the lack of multi-threaded download support in the official huggingface-cli, and the inadequate error handling in hf_transfer, This command-line tool leverages curl and aria2c for fast and robust downloading of models and datasets.

Features

  • ⏯️ Resume from breakpoint: You can re-run it or Ctrl+C anytime.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; BACK UP YOUR LOGSEQ DIR BEFORE RUNNING THIS!
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Copyright (C) Aug 4 2022, William R. Burdick Jr.
;;
;; LICENSE
;; This code is dual-licensed with MIT and GPL licenses.
@borkdude
borkdude / 01-README.md
Last active May 4, 2023 03:42
Shadow CLJS require ES Module in script

This shows how to require ES modules in a node script which is itself compiled as an ES module by shadow. I made this to verify if nbb's way of requiring ES modules aligns with other tools that accomplish the same using the CLJS compiler.

Build with npx shadow-cljs compile script. Run with node out/script.js. It will print something like:

#js {:columns 202, :rows 45}
[Function: Spinner]
(defonce ^Logger logger (doto (Logger/getLogger "clojure")
(.setUseParentHandlers false)
(.addHandler
(doto (ConsoleHandler.)
(.setLevel Level/ALL)
(.setFormatter
(proxy [SimpleFormatter] []
(format [^LogRecord record]
(let [sb (StringBuilder.)]
(.append sb "#:log{")
@baskeboler
baskeboler / clipboard.clj
Last active April 11, 2021 01:21 — forked from brake/clipboard.clj
Write pretty printed Clojure data structures to the clipboard
(ns clipboard.core
(:require [fipp.edn :as fipp])
(:import (java.awt.datatransfer DataFlavor Transferable StringSelection)
(java.awt Toolkit)
(java.io StringWriter))
(defn get-clipboard
"get system clipboard"
[]
(-> (Toolkit/getDefaultToolkit)
@Dangercoder
Dangercoder / auth.clj
Created November 21, 2020 18:42
Pedestal JWT authentication interceptor
(ns interceptors.auth
(:require [cheshire.core :as json]
[clojure.spec.alpha :as s]
[clojure.walk :refer [postwalk]]
[clojure.core.async :as a])
(:import (java.net URL)
(com.auth0.jwk GuavaCachedJwkProvider UrlJwkProvider)
(com.auth0.jwt.interfaces RSAKeyProvider ECDSAKeyProvider)
(com.auth0.jwt.algorithms Algorithm)
(com.auth0.jwt JWT)
@dvingo
dvingo / crux-pull.clj
Created May 5, 2020 16:22
pull api support for crux
(ns datascript-crux.pull-api
(:require
[crux.api :as crux]
[datascript.pull-parser :as dpp]
[my-app.crux-node :refer [crux-node]])
(:import [datascript.pull_parser PullSpec]))
;; lightly adapted from:
;; https://github.com/tonsky/datascript/blob/master/src/datascript/pull_api.cljc
;; https://github.com/tonsky/datascript/blob/master/src/datascript/pull_parser.cljc