Skip to content

Instantly share code, notes, and snippets.

@usr-ein
usr-ein / Dockerfile
Last active November 9, 2024 02:20
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
################################
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 September 10, 2023 10:12
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