Skip to content

Instantly share code, notes, and snippets.

View lagergren's full-sized avatar

Marcus Lagergren lagergren

View GitHub Profile
@lagergren
lagergren / gist:b45d8de5ef0c828a49a542d58396d6dc
Created May 7, 2024 08:06
Same version of pyright as ci.yml, but still get errors in master when running locally
~/src/zombiesnack compose-cleanup *1 !4 ?1 ❯ time pyright х INT Py thaum marcus@thaum 10:04:55
WARNING: there is a new pyright version available (v1.1.359 -> v1.1.361).
Please install the new version or set PYRIGHT_PYTHON_FORCE_VERSION to `latest`
/home/marcus/src/zombiesnack/src/camera/femtomega/camerasettings.py
/home/marcus/src/zombiesnack/src/camera/femtomega/camerasettings.py:23:12 - error: Operator "/" not supported for types "MatLike" and "int"
Operator "/" not supported for types "NumPyArrayGeneric" and "int" (reportOperatorIssue)
/home/marcus/src/zombiesnack/src/hyperformer/hyper_aloha/hyperspace_aloha.py
/home/marcus/src/zombiesnack/src/hyperformer/hyper_aloha/hyperspace_aloha.py:322:20 - error: Operator "|" not supported for types "dict[str, Any]" and "Unk
diff --git a/javatools_backend/build.gradle.kts b/javatools_backend/build.gradle.kts
new file mode 100644
index 000000000..63dea1e2f
--- /dev/null
+++ b/javatools_backend/build.gradle.kts
@@ -0,0 +1,33 @@
+/**
+ * Experimental Javatools backend.
+ */
+
@lagergren
lagergren / gist:094bd5b62f55c530208ee2fa7718eb0b
Created February 7, 2024 10:32
Docker container build time cloning and caching a particular source code version
This is normally not the Docker approach.
Volumes only exist during runtime, and any changing external source is usually retrieved on volume level and during startup
There may be use cases when you want to clone something from git during the Dockerfile during build, but they are not very common.
To clone a particular repo as part of the container build do:
ADD https://api.github.com/repos/org/reponame/git/refs/heads/$GITHUB_BRANCH version.json
RUN git clone --branch $GITHUB_BRANCH --depth=1 https://github.com/org/reponame repo
The verison.json will ADD will create a layer that is invalidated iff $GITHUB_BRANCH is updated, and then, rebuilding the container will
realize that this layer will be regenerated.