Skip to content

Instantly share code, notes, and snippets.

View mloskot's full-sized avatar
🏠
Working from home

Mateusz Łoskot mloskot

🏠
Working from home
View GitHub Profile

Hexagonal Architecture

From https://www.golinuxcloud.com/hexagonal-architectural-golang/

Hexagonal Architecture Components

  1. Core Business Logic: This is the central component of the architecture, and it contains the application's core domain logic. This component should be independent of any external systems and should not be affected by changes in the infrastructure or the user interface.
  2. Adapters: These are the components that connect the core business logic to the external systems. They can be thought of as the "ports" through which the application communicates with the outside world. Adapters can take many forms, including APIs, databases, user interfaces, and messaging systems.
@dims
dims / README.md
Last active April 18, 2024 06:16
Kubernetes Resources
@maxkoshevoi
maxkoshevoi / download-latest-release.ps1
Created April 9, 2021 18:05
Download latest GitHub release via Powershell
$repoName = "PowerShell/PowerShell"
$assetPattern = "*-win-x64.msi"
$extractDirectory = "C:\Users\Public\Downloads"
$releasesUri = "https://api.github.com/repos/$repoName/releases/latest"
$asset = (Invoke-WebRequest $releasesUri | ConvertFrom-Json).assets | Where-Object name -like $assetPattern
$downloadUri = $asset.browser_download_url
$extractPath = [System.IO.Path]::Combine($extractDirectory, $asset.name)
@mrl22
mrl22 / README.md
Last active May 26, 2022 12:38
Install and run IBM SPSS Licensing Manager as a systemctl / systemd service on RHEL / Debian Linux

wget https://softy.cac.washington.edu/spss/new/spss28/SPSSCLT9.9_-_LicMgrLinuxx86-64_En.gz

tar xvfz SPSSCLT9.9_-_LicMgrLinuxx86-64_En.gz

mkdir -p /opt/IBM/SPSS/Concurrent_Licensing_Tools/9.9.0/License_Manager

@ebta
ebta / install db driver php.md
Last active January 29, 2023 16:59
Install database driver extension (PosgreSQL, MS SQL, Oracle) di PHP - Ubuntu Server

Proses-proses berikut awalnya (utamanya) dijalankan di Ubuntu 20.04 dengan PHP 7.4, tetapi harusnya bisa diterapkan di versi selainnya.

Install Driver PosgreSQL

  1. Install driver PDO PgSQL, Default akan menginstall sesuai versi php, misalnya berikut ini akan install php7.4-pgsql. Setelah install, biasanya langsung aktif tanpa perlu restart php
sudo apt install php-pgsql

Install Driver SQL Server

@berkant
berkant / cloud-init.cfg
Last active April 26, 2024 17:58
Cloud-init config to set up my Ubuntu dev machine.
## template: jinja
#cloud-config
{% if v1.distro_release == 'focal' %}
users:
- name: berkant
shell: /usr/bin/bash
ssh_import_id: gh:berkant
sudo: ALL=(ALL:ALL) NOPASSWD:ALL
@JohnStrunk
JohnStrunk / rename-pvc.sh
Last active March 22, 2023 17:57
"Rename" a bound PVC
#! /bin/bash
set -e -o pipefail
function usage {
cat - <<USAGE
Usage:
$0 -n namespace -s source -d destination
USAGE
}
@MichaelSimons
MichaelSimons / RetrievingDockerImageSizes.md
Last active March 25, 2024 11:14
Retrieving Docker Image Sizes

Retrieving Docker Image Sizes

There are two metrics that are important to consider when discussing the size of Docker images.

  1. Compressed size - This is often referred to as the wire size. This affects how fast/slow images can be pulled from a registry. This impacts the first run experience on machines where images are not cached.
  2. Uncompressed size - This is often referred to as the size on disk. This affects how much local storage is required to support your Docker workloads.

The example commands shown below will work on Windows, MacOS, and Linux.

How to Measure the Compressed Size

Windows 10 - Using Git Bash With TMUX

Why Not Use WSL?

I tried the WSL and it isn't quite seamless enough for me. I ran in to problems when editing in VSCode and having watchers on my files (ng serve, dotnet watch run, etc.). In addition, I kept running in to problems that only manifest themselves when running in WSL. For example, this issue with doing production builds and the terser plugin has made many a developer rage-quit on using WSL. Just figuring out that it was an issue with the WSL took a lot of time.

That terser plugin issue was never resolved and I ended up having to keep a git bash window open in addition to my WSL console window so I could do production builds. To make matters worse, my npm packages were platform-dependent so I couldn't use the same project folder. So, my procedure was: commit whatever changes to test branch, push to repo, git pull on my "windows" project folder, and do a production build there

@bobvanderlinden
bobvanderlinden / README.md
Last active March 9, 2023 16:39
Example GraphQL call towards GitHub using curl and jq

This is an example how to do GraphQL queries in a somewhat sane way in bash using curl and jq.

The example does an query towards GitHub to fetch the commit SHAs of open pull requests for a specific repository.

The example needs the environment variables REPO_OWNER, REPO_NAME and GITHUB_TOKEN to be set.