Skip to content

Instantly share code, notes, and snippets.

View simongray's full-sized avatar

Simon Gray simongray

View GitHub Profile
@reborg
reborg / rich-already-answered-that.md
Last active February 18, 2026 01:27
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

@praveenpuglia
praveenpuglia / shadow-dom.md
Last active March 9, 2026 14:39
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - https://github.com/praveenpuglia/shadow-dom-in-depth for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.

@pesterhazy
pesterhazy / react_cljs_es6_classes.cljs
Last active June 5, 2025 21:57
ClojureScript: bare React with ES6 classes (extending React.Component, no createClass or reagent)
(ns demo.react-cljs-es6-classes
(:require [goog.object :as gobj]))
;; Demo of using bare React using ES6 classes (without createClass or reagent)
;;
;; Equivalent of Javascript/JSX:
;;
;; class MyComponent extends React.Component {
;; constructor(props) {
;; super(props);
@lagenorhynque
lagenorhynque / interceptors-into-the-core-of-pedestal.md
Last active November 11, 2022 07:11
Interceptors: Into the Core of Pedestal

Interceptors

Into the Core of Pedestal


カマイルカ🐬/laʒenɔʁɛ̃k/

(defprofile lagénorhynque
Goal CSS 3 XPath
All Elements * //*
All P Elements p //p
All Child Elements p>* //p/*
Element By ID #foo //*[@id=’foo’]
Element By Class .foo //*[contains(@class,’foo’)]
Element With Attribute *[title] //*[@title]
First Child of All P p>*:first-child //p/*[0]
All P with an A child Not possible //p[a]
Next Element p + * //p/following-sibling::*[0]
@joyheron
joyheron / custom-elements.cljs
Last active January 22, 2020 10:02
Define Custom Elements in ClojureScript
;; Solution based on https://stackoverflow.com/questions/50295703/create-custom-elements-v1-in-es5-not-es6
(defn define-element! [name on-connect]
(let [my-el (fn [] (this-as this (.construct js/Reflect js/HTMLElement #js [] (.-constructor this))))
_ (set! (.. my-el -prototype) (.create js/Object (.-prototype js/HTMLElement)))
_ (set! (.. my-el -prototype -constructor) my-el)
_ (.setPrototypeOf js/Object my-el js/HTMLElement)
_ (set! (.. my-el -prototype -connectedCallback) on-connect)]
(.define js/customElements name my-el)))
(define-element! :my-element #(.log js/console "hi!"))

React Native + macOS + Clojurescript

image

Project Catalyst

Since the recent release of Catalina, macOS has shipped with the ability to allow iOS/iPAD apps to run on macOS without any modification via a featureset known as Project Catalyst.

This is exciting, as writing React Native + Clojurescript apps as a target for the desktop is much more compelling than a pure Electron app (imo).

@nwh
nwh / naur.md
Created July 20, 2021 22:52 — forked from dpritchett/naur.md
Programming as Theory Building

Programming as Theory Building

Peter Naur, 1985

(copied from http://alistair.cockburn.us/ASD+book+extract%3A+%22Naur,+Ehn,+Musashi%22)

Introduction

The present discussion is a contribution to the understanding of what programming is. It suggests that programming properly should be regarded as an activity by which the programmers form or achieve a certain kind of insight, a theory, of the matters at hand. This suggestion is in contrast to what appears to be a more common notion, that programming should be regarded as a production of a program and certain other texts.

@derhuerst
derhuerst / 10-geekbench-6.md
Last active February 21, 2026 14:30
VPS price & performance comparison

Geekbench 6

product notes price (incl. VAT) dedic.? cores RAM SSD Yabs Geekbench ST Geekbench MT Geekbench version operating system date of benchmark
Hetzner CPX11 4,58€/m no 2 2GB 40GB - 1476/1496 2714/2732 Geekbench 6.3.0 Build 603408 (rosedale-main-build bca065a7d9) Ubuntu 22.04 2024-07-02
Hetzner CPX21 8,39€/m no 3 4GB 80GB - 1484/1474 3862/3792 Geekbench 6.3.0 Build 603408 (rosedale-main-build bca065a7d9) Ubuntu 22.04 2024-07-02
Hetzner CPX22 no IPv4

React.js interop POC — Electric Clojure

20220729.photon.reagent.react.interop.mp4