Skip to content

Instantly share code, notes, and snippets.

View superstructor's full-sized avatar
🎯
Focusing

Isaac Johnston superstructor

🎯
Focusing
View GitHub Profile
@superstructor
superstructor / install.sh
Created July 21, 2023 23:01
MERN Stack Ubuntu 22.04
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \
sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \
--dearmor
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
// $id: "",
$schema: "http://json-schema.org/draft-07/schema#",
title: "JSONWebKeySet",
description: "A set of JSON Web Keys, as defined in IETF RFC 7517.",
type: "object",
required: [
"keys",
],
/**
* From IETF RFC 7517, Section 5:
@superstructor
superstructor / comparison.adoc
Last active February 11, 2021 22:08
re-com-css
Table 1. Comparison of re-com CSS Options
Current Inline Styles 'Utility First' CSS Garden CSS Garden 'CSS in [CL]JS'

Removes re-com.css

Reverses CSS→DOM Dep

Composable

'Pruning' not Required

Styles as Data

Styles in Namespace

@superstructor
superstructor / README.md
Last active September 11, 2020 07:41
Dependency Resolution in CLJS+JS Projects

Part 1. Problem Definition

Dependency resolution and installation (provision) of mixed CLJS (maven) and JavaScript (npm) projects.

A Tangled Web

Lets consider a relatively simplified example in the following diagram:

+--------------+
@superstructor
superstructor / README.md
Last active September 4, 2020 04:34
re-frame Maps vs Vectors

Data Structure

Vectors

[:find-primes {:n 100}]

Maps & Maps++

Content Add-ins Leak Memory Eventually Crashing Add-in

Content Add-ins leak memory on every call to Excel.run() at a rate large enough to eventually crash the add-in.

TaskPane Add-ins with exactly the same code do not display the same behaviour.

The amount of memory leaked ranges from 10MB to 100MB per Excel.run() call.

The amount of memory leaked correlates with the complexity of the Excel.run()

@superstructor
superstructor / lein-git-inject.md
Last active December 30, 2019 04:26
lein-git-inject.md
  ;; left matched against [ "v0.0.4" ahead? dirty? ]
  ;; right matched against git describe --tags output "v0.0.4-5-ge2028de"
  :lein-git-inject {[#"v\d+\.\d+\.\d+" false? (constantly true)] #"v(\d+\.\d+\.\d+).*"
                    [#"v\d+\.\d+\.\d+" true?  (constantly true)] [#"v(\d+\.\d+\.\d+-\d+-[a-z0-9][8])" "-SNAPSHOT"]}

  ;; same but with static values instead of fns
  ;; except there is an issue with using `_` which is idiomatic syntax as we cannot write as a macro and:
 ;; WARNING: Can't take value of macro cljs.core/_ at line..
@superstructor
superstructor / README.md
Last active June 13, 2019 03:54
shadow-cljs

shadow-cljs Notes

Use as a library with Leiningen, not the default Node.js CLI. This is because lein has a lot of other stuff the Node.js CLI does not; e.g.

  • garden CSS compilation
  • publishing to Clojars
  • lein ancient
  • lein deps :tree

When used as a library with lein, dependencies and source paths in shadow-cljs.edn are ignored.

@superstructor
superstructor / gist:5754905
Created June 11, 2013 06:47
Or for a coffee order maybe consider that the order and the payment could be independent resources, thus you get
{
"_links": {
"self": {
"href": "/api/orders/123"
},
"profile": {
"href": "/profiles/order"
}
"/rels/payments": {
"href": "/api/orders/123/payments",
@superstructor
superstructor / gist:5754903
Last active December 18, 2015 08:29
"/rels/delete" could tell the client "this is the link to follow to delete the context resource", whereas "/profiles/delete" could tell the client that to do so you DELETE /api/customer/42 ? Since there is no entity body the generic /profiles/delete provides enough semantics for any resource i.e. just use the DELETE method. "/rels/update-form" c…
{
"_links": {
"self": {
"href": "/api/customers/42"
},
"profile": {
"href": "/profiles/customer"
},
"/rels/delete": {
"href": "/api/customers/42",