Skip to content

Instantly share code, notes, and snippets.

View mick-io's full-sized avatar

Mick Piereder mick-io

View GitHub Profile
@mick-io
mick-io / boostrap.sh
Last active February 6, 2024 20:41
Bootstrap script for new computers.
#!/bin/zsh
homebrew_fomulas=(
bat
btop
curl
docker
fzf
gawk
gsed
@mick-io
mick-io / text_border.rs
Last active June 22, 2023 18:08
Please review me.
/// `TextBorderOptions` is a structure used to specify the configuration for text borders.
///
/// # Fields
///
/// * `border_char` - The character used to create the border.
/// * `border_thickness` - A tuple specifying the border thickness in the order (left, top, right, bottom).
/// * `margin_thickness` - A tuple specifying the margin thickness in the order (left, top, right, bottom).
/// * `prevent_trim` - A boolean flag indicating whether to prevent trimming whitespace from the message.
///
/// # Examples
@mick-io
mick-io / regions.cs
Last active May 16, 2023 18:35
C# enums for US States and Candian Provinces
public enum USState
{
ALABAMA = "AL",
ALASKA = "AK",
ARIZONA = "AZ",
ARKANSAS = "AR",
CALIFORNIA = "CA",
COLORADO = "CO",
CONNECTICUT = "CT",
DELAWARE = "DE",
@mick-io
mick-io / fs.util.ts
Created July 27, 2022 18:28
Utility function for recursively resolving the absolute path of each file with in a directory and it's subdirectories
import fs from 'fs';
import path from 'path';
/**
* resolveFilePaths returns the absolute paths of files contained with a
* directory and it's sub directories.
* @param dirPath the parent path
* @returns The absolute paths of the files
*/
export async function resolveFilePaths(dirPath: string): Promise<string[]> {
@mick-io
mick-io / random-name-selector.html
Created March 25, 2021 15:36
Random Name Selector
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>STG Dev Center Random Name Selector</title>
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
@mick-io
mick-io / fizzbuzz.c
Last active February 18, 2021 22:25
FizzBuzz solved using a variety of programming languages
#include <stdio.h>
#include <string.h>
void fizzbuzz()
{
for (int i = 1; i < 101; i++)
{
char s[9] = "";
if (i % 3 == 0)
@mick-io
mick-io / string-permutations.go
Last active February 19, 2021 17:33
String Permutations
package main
import "fmt"
func main() {
permutations := createPermutations("abc")
fmt.Println(permutations)
}
func createPermutations(s string) (permutations []string) {
@mick-io
mick-io / sort_extentions.py
Created December 15, 2020 20:38
A python script for sorting the files within the passed directories by file extensions. A new directory will be created for each file extensions within the passed parent directory with the respective extensions names. Files with matching extensions will be moved into the new directory
#!/usr/bin/env python3
"""Sort Extensions
This script sorts the files within the passed directories by file extensions. A
new directory will be created for each file extensions within the passed parent
directory with the respective extensions names. Files with matching extensions
will be moved into the new directory.
BEFORE FILE TREE EXAMPLE:

Docker Container CLI Commands

Run a container

# Running a container
# '-d' flag: Run container in background and print container ID
# '--name string' flag: Assign a name to the container
# '-p' flag: Publish a container's port(s) to the host
@mick-io
mick-io / pong.py
Created February 4, 2020 01:12
Python Pong
#!/usr/bin/env python3
import turtle
# Adjust this value to increase or decrease the ball's movement speed.
BALL_PIXELS_PER_MOVEMENT = .15
SCORE_FONT = ("Courier", 24, "normal")
score_a, score_b = 0, 0
window = turtle.Screen()