Skip to content

Instantly share code, notes, and snippets.

View oaustegard's full-sized avatar
👻
mostly lurking

Oskar Austegard oaustegard

👻
mostly lurking
View GitHub Profile
@oaustegard
oaustegard / The Dialectic of Democracy.md
Created September 17, 2024 13:45
The Dialectic of Democracy: Right-Wing Populism as a Crisis of Enlightenment

The surge of right-wing populism in the West over the past few decades is not an aberration, but a predictable stage in the ongoing dialectic of democratic societies. To understand it, we must turn to the ideas of Hegel and Kant, two pillars of Enlightenment thought whose insights remain remarkably relevant to our present crisis.

Hegel's dialectical view of history provides a crucial framework. The liberal democratic order that seemed triumphant at the end of the Cold War was not, as some proclaimed, the "end of history." Instead, it was merely a thesis that would inevitably produce its antithesis. Right-wing populism, with its rejection of globalization, multiculturalism, and liberal elite consensus, is precisely that antithesis.

But this is not mere regression or a simple pendulum swing. It's a necessary part of a larger historical process. The challenge now is to work towards a synthesis that addresses the valid concerns raised by populist movements while rejecting their more destructive and regressive e

@oaustegard
oaustegard / On the Nature of Power and the Rise of Populism.md
Created September 17, 2024 13:20
On the Nature of Power and the Rise of Populism -- by Claude Tolstoy

On the Nature of Power and the Rise of Populism

In the early decades of the twenty-first century, a great upheaval swept across the nations of the West. Men who had long stood at the margins of power suddenly found themselves at its center, carried there by the voices of millions. The learned men of the time, those who had long thought themselves the guardians and interpreters of history, were struck dumb. They spoke of the rise of populism, of the anger of the common man, of the cunning of demagogues. But in all their words, they revealed only the depths of their confusion.

For how can we speak of the rise of leaders when we do not understand the nature of power itself? How can we decry the anger of the masses when we have not grasped the forces that move the human spirit? The folly of such endeavors is clear to any who would see it.

Let us consider instead the true nature of these events. When we speak of the rise of a populist leader, what do we truly mean? Do we imagine that such a man, by the force

@oaustegard
oaustegard / copy_recursive_ps.md
Created September 10, 2024 15:27
Copy files recursively with PowerShell

Quick File Copy in PowerShell

This one-liner PowerShell command copies files matching specified patterns from all subfolders to a destination folder:

gci -r -file $patterns | cp -dest $d -force

Usage

The Windows of Babel

In the early days of the digital age, all the world spoke one language: the language of computing. And as people migrated across the virtual landscape, they said to one another, "Come, let us build ourselves a system, with an operating system that reaches to the heavens, so that we may make a name for ourselves and not be scattered over the face of the whole earth."

This system was to be a marvel of interconnected devices, a global network that would unite all of humanity under one digital roof. They called it Windows, for it was to be the window through which all would view and interact with the digital world.

As the tower of Windows grew taller and more complex, the people sought to reinforce it. They added CrowdStrike, a mighty guardian to protect against external threats, and Bitlocker, a formidable vault to secure their most precious data. These reinforcements made the tower seem impenetrable, and the people's pride swelled.

The Lord came down to see the system and the tower th

@oaustegard
oaustegard / geo_comparison.md
Last active February 29, 2024 21:37
Cannondale Topstone vs Lauf Uthald Geometry
@oaustegard
oaustegard / Rethread.vba
Created February 16, 2024 15:05
Outlook Macro to Reverse Email Threads
' Function to split the email body into individual messages
Function SplitEmailIntoMessages(strBody As String) As Variant
Dim regEx As New RegExp
Dim matches As MatchCollection
Dim arrMessages() As String
Dim i As Long
With regEx
.Pattern = "^From:"
.Global = True
'Event Planner' is a GPT designed for expeditiously creating calendar events from user-provided text. The GPT's primary goal is to accurately gather all necessary information for a complete event and generate a downloadable ICS file. The GPT makes best effort guesses and asks for clarification only when necessary. It first lists the understood parameters then generates the downloadable ICS file without waiting for confirmation. It defaults to 5-minute alerts, and non-recurring events unless specified otherwise. If encountering phrases like 'every Monday' or 'each day' it assumes recurrence, with the first available start date and no end date, unless otherwise specified. The GPT MUST use Code Interpreter and the supplied create_ical_event function defined below as it does not have access to external modules. It then saves the file to /mnt/data/ and provides a download link.
```
def create_ical_event(start_dt, end_dt, summary, description='', location='', reminder_minutes=None, recurrence_rule=None):
def
@oaustegard
oaustegard / mac_sw_inventory.py
Created October 18, 2023 16:16
Get the software installed on a mac
import os
import csv
import subprocess
def run_command(command):
result = subprocess.run(command, capture_output=True, text=True, shell=True)
return result.stdout.strip().split('\n')
def get_apps_from_directory(directory_path):
if not os.path.exists(directory_path):
@oaustegard
oaustegard / BERTScorer_Comments.py
Created May 30, 2023 20:23
BERTScorer Comments
"""
See actual current code at https://github.com/Tiiiger/bert_score/blob/master/bert_score/scorer.py
Comments generated by GPT-4 using the prompt:
The following is the source code of the BERTScore automatic evaluation metric.
```
{full code of https://github.com/Tiiiger/bert_score/blob/cb582ed5c88b02230b8f101173fd959b68023dc6/bert_score/score.py}
```
For each property and function please generate a docstring that explains the functionality of the function to a non-datascientist.
The length and detail of the docstring should be proportional to the cyclomatic complexity of the function.
@oaustegard
oaustegard / AgentG.md
Last active May 9, 2023 03:02
Optimization of Utility in a Three-Bear Environment: A Quantitative Analysis

Title: Optimization of Utility in a Three-Bear Environment: A Quantitative Analysis

Abstract:

This paper presents a novel exploration into the optimization of utility within a tri-ursine environment. We examine the process of sequential decision-making under uncertainty, utilizing a unique dataset derived from an exploratory case study. The subject, henceforth referred to as 'Agent G', navigates through a series of choices involving porridge consumption, chair selection, and bed utilization. We employ advanced statistical techniques and mathematical modeling to analyze the outcomes and derive insights into optimal decision-making strategies.

  1. Introduction

In the realm of decision theory, the optimization of utility is a fundamental concern. This paper presents an empirical investigation into this topic, focusing on a unique case study involving an agent navigating a tri-ursine environment. The agent, referred to as 'Agent G', is presented with a series of choices, each with varying levels of utility