Skip to content

Instantly share code, notes, and snippets.

@JeffreyVdb
JeffreyVdb / count_workspace_resources.sh
Last active June 7, 2023 09:43
Count terraform workspace managed resources
#!/bin/bash
set -euo pipefail
count_managed_resources() {
jq '[.resources[] | select(.mode == "managed") | select(.type == "terraform_data" or .type == "null_resource" | not) | .instances | flatten[]] | length'
}
ROOT_DIR=${1:-.}
ABS_ROOT_DIR=$(readlink -f "$ROOT_DIR")
@JeffreyVdb
JeffreyVdb / init.vim
Created April 12, 2022 18:39
Neovim New Config
" Use vim settings, rather then vi settings (much better!)
" This must be first, because it changes other options as a side effect.
set nocompatible
set nu
set syntax
"""
""" Keyshort shortcuts
"""
@JeffreyVdb
JeffreyVdb / settings.json
Created February 14, 2022 14:56
VSCode Settings
{
// =======================================
// Editor stlye and default behavior
// =======================================
"editor.minimap.enabled": true,
"editor.fontFamily": "'Cascadia Code Light', 'Jetbrains Mono'",
"editor.fontSize": 13,
"editor.lineHeight": 30,
"editor.fontLigatures": true,
"editor.rulers": [
#!/bin/bash
set -euo pipefail
echo "Which version do you want to see?"
echo "web or pdf?"
read -r ANSWER
RESUME_URL="https://registry.jsonresume.org/JeffreyVdb"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Jeffrey Vandenborne",
"label": "Software Engineer - Sysadmin - Tech geek",
"image": "",
"email": "jeffrey@vandenborne.co",
"phone": "+32483126523",
"url": "https://jeffrey.vandenborne.co",
"summary": "I believe that a good software engineer should be like a chameleon: instantly able to adapt the technologies required for the task at hand. Choosing the right tool for the job is the real complexity.",
@JeffreyVdb
JeffreyVdb / build-path.py
Last active December 29, 2021 19:45
Build PATH variable via checking if the provided arguments are existing directories
import sys
import os.path
if __name__ == "__main__":
paths = [p for p in sys.argv[1:] if os.path.exists(p) and os.path.isdir(p)]
if not paths:
sys.exit(0)
print(os.path.pathsep.join(paths))
@JeffreyVdb
JeffreyVdb / prio-paths.zig
Created November 29, 2021 15:56
Prioritize paths
const std = @import("std");
const HashMap = std.HashMap;
const Allocator = std.mem.Allocator;
const StringHashMap = std.hash_map.StringHashMap;
const SinglyLinkedList = std.SinglyLinkedList;
pub fn main() !void {
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
defer arena.deinit();
@JeffreyVdb
JeffreyVdb / chown.zig
Last active October 22, 2021 12:28
Change owner of a file / directory using zig
const c = @cImport(@cInclude("unistd.h"));
const std = @import("std");
const ChownData = struct {
uid: c_uint,
gid: c_uint,
filename: [:0]const u8,
};
pub fn main() !void {
#!/bin/bash
set -euo pipefail
mktempfile() {
tmpfile=$(mktemp --tmpdir=/tmp "$1")
echo "Created $tmpfile" >/dev/tty
printf "%s" "$tmpfile"
}
KEY_NAME="${1:-}"
@JeffreyVdb
JeffreyVdb / keybase.md
Created October 8, 2018 06:38
keybase.md

Keybase proof

I hereby claim:

  • I am JeffreyVdb on github.
  • I am jeffreyvdb (https://keybase.io/jeffreyvdb) on keybase.
  • I have a public key whose fingerprint is 389A 3305 D823 729D 7FF8 A8C0 53D4 B3FF B09B 6422

To claim this, I am signing this object: