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.

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

Docker stats collection for collectd

This script can be used to feed collectd with cpu and memory usage statistics for running docker containers using the collectd exec plugin.

This script will report the used and cached memory as well as the user and system cpu usage by inspecting the appropriate cgroup stat file for each running container.

Usage

This script is intented to be executed by collectd on a host with running docker containers. To use, simply configure the exec plugin in collectd to execute the collectd-docker.sh script. You may need to adjust the script to match your particulars, such as the mount location for cgroup.