Skip to content

Instantly share code, notes, and snippets.

View eval's full-sized avatar
💭
ƛ

Gert Goet eval

💭
ƛ
View GitHub Profile
@eval
eval / re_named_captures.clj
Last active March 21, 2024 15:44
deps-try recipe to play around with the code from https://polar.sh/eval/posts/named-group-captures-in-clojure
;; Use this file with [deps-try](https://github.com/eval/deps-try)
;; $ docker run -it ghcr.io/eval/deps-try --recipe https://gist.github.com/eval/60989e7782397c1aff7a47978b1931d9
;; This work is licensed under [CC BY 4.0](http://creativecommons.org/licenses/by/4.0/)
(ns blog.re-named-captures
"Example code from https://polar.sh/eval/posts/named-group-captures-in-clojure (requires Java >= v20)."
(:require [clojure.string :as str]))
;; the regex from the blogpost
(def url-re
#"(?x)
@eval
eval / juxt_blog_uri_template.clj
Last active February 15, 2024 14:57
deps-try recipe to step through examples of https://www.juxt.pro/blog/uri-templates/
;; Use this file with [deps-try](https://github.com/eval/deps-try)
;; $ deps-try --recipe https://gist.github.com/eval/5af8064aa31bb981f573c3b4a9bb6684/raw
(ns recipes.juxt-blog-uri-template
"Recipe to step through the examples from https://www.juxt.pro/blog/uri-templates/"
{:deps-try.recipe/deps ["https://github.com/juxt/reap"]}
(:require [juxt.reap.rfc6570 :refer [compile-uri-template make-uri match-uri]]))
;; helper-fns
(defn render [tpl variables]
(make-uri (compile-uri-template tpl) variables))
{:paths
["."]
:deps
{org.clojure/clojurescript {:mvn/version "1.10.339"
#_#_:git/url "https://github.com/clojure/clojurescript.git"
#_#_:sha "6eedd0a08c49f7b0d4dcb30977b2fb38c90577bd"}}}
@eval
eval / .gitignore
Created October 2, 2018 11:20 — forked from caskolkm/logging.cljc
Simple Clojurescript logging using Google Closure logging tools, now in cljc :)
out/
@eval
eval / clojure-intro.md
Last active July 12, 2017 13:05 — forked from nicorikken/clojure-intro.md
HelloData Clojure intro
@eval
eval / set-game.clj
Last active May 10, 2017 07:46 — forked from cgrand/set-game.clj
the SET game in clojure.spec
;; the SET game in clojure.spec
;; inspired by https://github.com/jgrodziski/set-game
;; run via:
;; $ lein try org.clojure/spec.alpha org.clojure/test.check "0.9.0"
;; requires the following in ~/.lein/profiles.clj
;; {:repl
;; {:dependencies [
;; ^:displace [org.clojure/clojure "1.9.0-alpha15"]
;; [org.clojure/test.check "0.9.0"]
;; ]}
@eval
eval / hello.rb
Created March 20, 2017 17:09
pry-try demo-script
@a = 1
puts "Hello Gist!"
@eval
eval / prype
Last active March 2, 2017 23:38
#!/usr/bin/env bash
# pipe stuff to pry followed by a repl:
# gist -r 36b4092748310bc8ec020f5e4dad8ea9 | prype
var=`cat;echo; echo '$stdin = $stdin.reopen "/dev/tty";'`
printf "${var}" | pry
Gem::Specification.new do |s|
s.name = 'rubytapas-sequel'
s.description = 'Follow along with http://devblog.avdi.org/2015/05/26/rubytapas-freebie-sequel/'
s.version = '0.0.1'
s.require_path = '.'
s.add_dependency "sequel"
s.add_dependency "sqlite3"
end
alias alert='say -v "$([ $? = 0 ] && echo Good News || echo Bad News)" done'