Skip to content

Instantly share code, notes, and snippets.

View JonasReich's full-sized avatar

Jonas Reich JonasReich

View GitHub Profile
@JonasReich
JonasReich / powershell_cheatsheet.md
Last active December 2, 2019 22:42
A cheat sheet for the power shell syntax and behavioral quirks I stumble across the most

PowerShell Cheat Sheet

When coming from other scripting environments (CMD, Python) it can sometimes be a bit confusing how PowerShell does things. These are the 10 points that surprise me the most after not using PowerShell for a while:

1. Execution Policy

By default PS is configured not to load any configuration files and not to allow running of .ps1 script files. This can be changed by either changing the ExecutionPolicy, or by unblocking a specific script file:

# Change the execution Policy (requires launching PowerShell with admin rights):
// Copyright 2019, Jonas Reich. All Rights Reserved.
// This file was created for an Unreal Engine project. Feel free to change uint32 to a custom unsigned integer type.
#include "CoreMinimal.h"
#pragma once
/**
* Get the number of bits required to display a given number.
* #TODO: Should be extended with static asserts to ensure it only compiles with unsigned integer types
@JonasReich
JonasReich / satisfactory_supercomputer.py
Created September 12, 2021 23:17
Satisfactory Resource Calculator (Supercomputer)
import math
# All available resource recipes
# Uncomment the ones that you want to resolve
recipes = {
# Computer components
"supercomputer": [[2, "ai limiter"], [3, "high speed connector"], [2, "computer"], [28, "plastic"]],
"ai limiter": [[20, "quickwire"], [5, "copper sheet"]],
"high speed connector": [[56, "quickwire"], [10, "cable"], [1, "circuit board"]],
"circuit board": [[2, "copper sheet"], [4, "plastic"]],
@JonasReich
JonasReich / git_config.cmd
Created September 29, 2019 22:41
Git configuration/setup script
@echo off
echo ------------------------------------------
echo git_config.cmd - Git configuration Script
echo (c) Jonas Reich, 2019
echo ------------------------------------------
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Script config
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@JonasReich
JonasReich / ExtractTextureReportFromMemreport.ps1
Last active June 3, 2024 13:57
Extract Texture Report csv from UE4 Memreport
# Copyright: Jonas Reich 2021
# Extracts the texture report table from UE4 .memreport files and stores them as separte csv files.
# Uses semicolon delimiters and opens the extracted file with its default application (for me: Excel)
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,ValueFromPipeline = $true)]
[String]
$SourceFile
)