Skip to content

Instantly share code, notes, and snippets.

View respatialized's full-sized avatar
📶
stabilizing

respatialized

📶
stabilizing
View GitHub Profile
@danielcompton
danielcompton / ext.clj
Last active July 5, 2021 15:53
Extended attributes in Clojure
(defn supports-extended-attributes?
"Not all filesystems suport Java's UserDefinedFileAttributes (a.k.a. extended attributes),
notably HFS+ and APFS on macOS.
Waiting for https://bugs.openjdk.java.net/browse/JDK-8030048 to add macOS support."
[^Path path]
(.supportsFileAttributeView
(Files/getFileStore path)
^Class UserDefinedFileAttributeView))
;;; wpgtk-theme.el --- Dynamic color theme, specially made for wpgtk
;; based on: <https://github.com/warreq/xres-theme>
;;
;; Version: 0.1
;; Keywords: color, theme
;; Package-Requires: ((emacs "24"))
;; Initially with the help of emacs-theme-generator, <https://github.com/mswift42/theme-creator>.
;; Modified directly from Nasser Alshammari's spacemacs theme
@shaunlebron
shaunlebron / realtalk.md
Last active December 18, 2024 02:12
why Dynamicland Realtalk isn't open source

Transcribed from an interview with Toby Schachman and Paula Te on The Afrofuturist Podcast:

There's this notion of the open-source movement. There are a lot of things
that we totally resonate with that because it's about understanding how your
technology works. We're totally 100% on board with that.

But then there are other issues with the open-source community, where it's
very internet-based and so open-source ends up benefitting this group of
people who have really strong access to internet and understand how to use
@kachayev
kachayev / aleph-planning.md
Last active December 12, 2022 16:28
A few thoughts on Aleph development

Aleph, Async, HTTP, Clojure

I've been working with Aleph rougly for last 5 years, actively contributing to the library for last 2 (or so). I also put some effort into spreading the word about it, including educational tech talks, like "Deep HTTP Dive Throught Aleph & Netty". But the more I talk to people the more confusion I find, mostly about how Aleph works and what can you expect when adding it to your stack. Clojurists Together has recently announced Aleph to get Q1 funding, I think it's a good time to share my priorities and thoughts on development plans that were mentioned in the blog post. Hope the community would find it interesting and helpful.

Aleph describes itself as "asynchronous communication for Clojure" library. And you should probably pay a good portion of your attention to the first word: "asynchronous".

@paulkoegel
paulkoegel / garden-cheat-sheet.clj
Last active February 20, 2022 21:09
Garden (CSS in Clojure) Cheat Sheet
;; https://github.com/noprompt/garden
[:h1 {:color "green"}]
;; multiple selectors
[:h2 :h3 {:color "orange"}]
;; => h1, h2 { color: orange; }
;; descendants
[:h1 [:a {:text-decoration "none"}]]
@jeroenvandijk
jeroenvandijk / .closhrc.cljc
Created April 8, 2019 14:03
First experiment with closhrc
(defcmd git [& [dispatch :as args]]
(if (= dispatch "browse")
(let [{:keys [code stderr]
remote-url :stdout} (sh-value "git" "remote" "get-url" "origin")]
(if (zero? code)
(do (println "Opening" remote-url)
(sh "open" (clojure.string/trim remote-url)))
(println stderr)))
(eval `(sh "git" ~@args))))
@jeroenvandijk
jeroenvandijk / git.zsh.clj
Last active August 29, 2019 17:16
bash to closh porting examples (https://github.com/dundalek/closh)
(defcmd git [& [dispatch :as args]]
(if (= dispatch "browse")
(let [{:keys [code stderr]
remote-url :stdout} (sh-value "git" "remote" "get-url" "origin")]
(if (zero? code)
(do (println "Opening" remote-url)
(sh "open" (clojure.string/trim remote-url)))
(println stderr)))
(eval `(sh "git" ~@args))))
(require '[clojure.string :as string]
'[meander.match.delta :as r.match]
'[meander.strategy.delta :as r]
'[meander.substitute.delta :as sub])
(def html
[:html {:lang "en"}
[:head
[:meta {:charset "UTF-8"}]
@joinr
joinr / spectraining.clj
Created June 4, 2019 18:39
spec experiment with org
;;A port of an awk script that munges
;;code to .org mode documentation,
;;let's do it with spec!
(ns spectraining.doc
(:require [clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[clojure.spec.test.alpha :as stest]
[clojure.string :as str]))
@mhuebert
mhuebert / _.md
Last active April 24, 2024 09:41
shadow-cljs build hook for purgecss

purgecss is a tool for removing unused css classes from source files. It's particularly useful for functional css frameworks like tachyons, where it's normal to only use a tiny fraction of available classes. This gist contains example code you could use to add purgecss to a shadow-cljs build.

  • make sure to yarn add purgecss first
  • usage is (hooks/purge-css {:css-source __ :js-globs __ :out-dir __})
    • :css-source is the path to the original, bloated CSS file (from project root). This is ideally in a source directory, or node_modules as in this example. This cannot be the public path where the css is ultimately read.
  • :js-globs is a string / vector of strings, indicating which files to read as input. These should be all of your compiled javascript bundles which contain your views. purgecss does a brute-force parse of all these files, extracting all the strings to figure out which clas