Skip to content

Instantly share code, notes, and snippets.

@usr-ein
usr-ein / Dockerfile
Last active March 5, 2025 14:13
Optimal multistaged Dockerfile for poetry
# syntax=docker/dockerfile:1
# Keep this syntax directive! It's used to enable Docker BuildKit
# Based on https://github.com/python-poetry/poetry/discussions/1879?sort=top#discussioncomment-216865
# but I try to keep it updated (see history)
################################
# PYTHON-BASE
# Sets up all our shared environment variables
################################
@awakecoding
awakecoding / pwsh-oras-manifest.ps1
Created September 16, 2021 14:52
Fetch PowerShell release information and convert to an ORAS artifact manifest
# Fetch latest PowerShell release information from GitHub and export ORAS manifest
$Headers = @{
Accept = "application/vnd.github.v3+json";
}
$RequestParams = @{
Method = 'GET';
Headers = $Headers;
Starting from balanced:
(sys, eng, wep)
(1.5, 1.5, 3.0) = right
(1.5, 3.0, 1.5) = up
(3.0, 1.5, 1.5) = left
(1.0, 1.0, 4.0) = right, right
(2.5, 2.5, 1.0) = left, up
(1.0, 4.0, 1.0) = up, up
(2.5, 1.0, 2.5) = left, right
(4.0, 1.0, 1.0) = left, left
@JosephPecoraro
JosephPecoraro / shell-execution.rb
Last active March 19, 2025 06:46
Shell Execution in Ruby
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Synchronous (blocking)
# Returns the output of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111