From 929ae9001d679e16cda0e47990a2bf601c1e8be9 Mon Sep 17 00:00:00 2001 From: hexlocation Date: Sat, 28 Sep 2024 10:17:52 +0200 Subject: [PATCH] add zig (programming language) --- docker/docker-compose.md | 12 ++++++------ docker/docker.md | 24 +++++++++++++++++++++--- zig/Zig Programming Language.md | 20 ++++++++++++++++++++ 3 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 zig/Zig Programming Language.md diff --git a/docker/docker-compose.md b/docker/docker-compose.md index 1e06417..bc029d0 100644 --- a/docker/docker-compose.md +++ b/docker/docker-compose.md @@ -4,13 +4,13 @@ ``` # docker-compose.yml -version: '3' # Deprecated. +version: '3' # Deprecated. Added for backwards-compatibility services: - alpine: - image: alpine:latest - container_name: alpine-example + example01: + image: [image]:[tag] + container_name: example-container-01 ports: - - 8001:8001 + - 80:80 environment: - SECRET_PASSWORD="a secret!" ``` @@ -21,7 +21,7 @@ services: docker compose up -d ``` -### Spin up compose file +### Run compose file ``` docker compose up diff --git a/docker/docker.md b/docker/docker.md index fb06e3d..dc6a559 100644 --- a/docker/docker.md +++ b/docker/docker.md @@ -3,17 +3,35 @@ ### Run interactive, temporary container ``` -docker run --rm -it alpine +docker run --rm -it [image] ``` ### Kill container ``` -docker kill [service] +docker kill [id] ``` ### Remove container ``` -docker rm [service] +docker rm [id] ``` + +### Get container logs + +``` +docker logs [id] +``` + +### List active containers + +``` +docker ps +``` + +### List all containers + +``` +docker ps --all +``` \ No newline at end of file diff --git a/zig/Zig Programming Language.md b/zig/Zig Programming Language.md new file mode 100644 index 0000000..e4b6629 --- /dev/null +++ b/zig/Zig Programming Language.md @@ -0,0 +1,20 @@ +## Hello World example + +``` +const std = @import("std"); + +pub fn main() void { + std.debug.print("Hello World!", .{}); +} +``` + +## Define array + +``` +.{69, 420} +``` +## Importing a module + +``` +const [variable name of choosing] = @import("module name"); +```