This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:paths | |
["."] | |
:deps | |
{org.clojure/clojurescript {:mvn/version "1.10.339" | |
#_#_:git/url "https://github.com/clojure/clojurescript.git" | |
#_#_:sha "6eedd0a08c49f7b0d4dcb30977b2fb38c90577bd"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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"] | |
;; ]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@a = 1 | |
puts "Hello Gist!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias alert='say -v "$([ $? = 0 ] && echo Good News || echo Bad News)" done' |
NewerOlder