Skip to content

Instantly share code, notes, and snippets.

View timabell's full-sized avatar
🍵
418 I'm a teapot

Tim Abell timabell

🍵
418 I'm a teapot
View GitHub Profile
Cart
Create your application to work without either a UI or a database so you can run automated regression-tests against the application, work when the database becomes unavailable, and link applications together without any user involvement.
Japanese translation of this article at http://blog.tai2.net/hexagonal_architexture.html
Spanish translation of this article at http://academyfor.us/posts/arquitectura-hexagonal courtesy of Arthur Mauricio Delgadillo
original explanation w updates at http://wiki.c2.com/?HexagonalArchitecture and http://wiki.c2.com/?PortsAndAdaptersArchitecture
@timabell
timabell / dependency-injeciton-in-rust.md
Last active May 3, 2023 10:33
GPT tells me all the ways of doing DI in Rust
@timabell
timabell / clippy.txt
Created February 18, 2023 10:36
gitopolis clippy linting output, first rust lint ever
tim@max:~/repo/gitopolis (main)
$ cargo clippy
warning: this `else { if .. }` block can be collapsed
--> src/repos.rs:84:11
|
84 | } else {
| ____________________^
85 | | if !repo.tags.iter().any(|s| s == &tag_name.to_string()) {
86 | | repo.tags.push(tag_name.to_string());
87 | | }
[[repos]]
path = "gitopolis"
tags = ["tim"]
[repos.remotes.origin]
name = "origin"
url = "[email protected]:timabell/gitopolis.git"
[[repos]]
path = "schema-explorer"
tags = ["tim", "databases"]
# Begin Open GApps Install Log
------------------------------------------------------------------
ROM Android version | 127
ROM Build ID | twrp_lemonadep-eng 127 RQ1A.210205.004 6 test-keys
ROM Version increment | 6
ROM SDK version | 30
ROM/Recovery modversion |
Device Recovery | TWRP 3.6.0_11-0-d0b854b3
Device Name | OnePlus9Pro
Device Model | OnePlus 9 Pro 5G
#!/bin/sh
# run with `source fix-omnisharp-asdf.sh` to ensure environment variables are made available
# https://stackoverflow.com/questions/70820780/vscode-or-anothers-editors-dont-recognize-sdk-dotnet-installed-with-asdf/70820974#70820974
# tell omnisharp where to find the current dotnet sdk installed by asdf-vm
version=`asdf current dotnet-core | awk '{print $2}'`
echo "Parsed version: $version"
export DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR=$(echo $HOME/.asdf/installs/dotnet-core/$version/sdk/$version/Sdks)
export DOTNET_MSBUILD_SDK_RESOLVER_SDKS_VER=$version
///// an exercise in object and array destructuring
// https://gist.github.com/timabell/0757735a759ed086fc57f51014392587
// https://jsfiddle.net/sz479ecd/
// object and array destructuring example
let sourceObject = {
propertyA: 2,
propertyB: [3, 4, 5],
z: 99,
};
@timabell
timabell / rehash.sh
Last active September 1, 2024 21:22
hashdeep orchestrator for data integrity checks in home folder
#!/bin/sh -v
cd ~
# in docs subdirectory so it is sync'd with syncthing
hash_file="Documents/hashdeep-checksums.txt"
mv "$hash_file" "$hash_file.bak"
backup_paths=(Music Downloads Documents Pictures Phone Dropbox repo oneplus9-home)
#!/bin/sh
# tag grabber from: https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
# original install instructions https://docs.docker.com/compose/install/
latest_tag=`curl --silent "https://api.github.com/repos/docker/compose/releases/latest"|grep '"tag_name":'|sed -E 's/.*"([^"]+)".*/\1/'`
target=~/Documents/programs/bin/docker-compose
curl -L "https://github.com/docker/compose/releases/download/$latest_tag/docker-compose-$(uname -s)-$(uname -m)" -o $target
chmod +x $target
# erd for https://github.com/DFE-Digital/early-careers-framework/
# view: https://dreampuf.github.io/GraphvizOnline/?url=https://gist.githubusercontent.com/timabell/d12c9cde5f88ef618d03d7aacb84b7e7/raw/f2e4105632d8612484058b6366679cdc851f89ee/entity-relationship-diagram.dot
# dot source: https://gist.github.com/timabell/d12c9cde5f88ef618d03d7aacb84b7e7
# to regenerate this:
# - checkout branch `entity-relationship-diagram-outputs`
# - rebase on `develop`
# - `bundle`
# - `bundle exec erd --filetype=dot`
# - upload `tmp/entity-relationship-diagram.dot` to gist
# - link to gist with `https://dreampuf.github.io/GraphvizOnline/?url=`+your url