Skip to content

Instantly share code, notes, and snippets.

@asears
asears / param_utils.py
Created October 12, 2024 21:49
Parametrize Decorator for DRY repeatable parameterize
# https://github.com/databricks/mlops-stacks/blob/main/tests/utils.py#L53
# Example of decorator for parameters
import os
import pathlib
import pytest
import json
import subprocess
from functools import wraps
@asears
asears / typecheck.py
Last active October 12, 2024 21:28
Type Checking Only Import
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from pyspark.sql import DataFrame
def to_json_conversion(self: "DataFrame") -> "RDDAdapter":
@asears
asears / win11.md
Created October 2, 2024 00:28
Win11 Setup

Right click menu

Some of us have to use this every time we right-click, which is highly annoying. Thankfully, there’s a way to revert to the old menu permanently. All it involves is adding an entry to the registry via the command line. Here’s what you must do to get the old right-click menus back via Microsoft:

Right-click the Start button and choose Windows Terminal

Copy and paste this into the window: reg.exe add "HKCU\Software\Classes\CLSID{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve

Close Terminal

@asears
asears / ruff.md
Last active March 31, 2024 18:59
Ruff Checking

Ruff

Installation

pip install uv
uv pip install ruff

Checks

@asears
asears / securitychecks.md
Last active March 30, 2024 12:30
Security checks and utilities
@asears
asears / rustclis.md
Last active March 30, 2024 11:06
Rust-built cli tools and replacements
@asears
asears / install.sh
Created March 29, 2024 13:34
dependabot cli
# Dependabot Cli
https://github.com/dependabot/cli
```shell
go install github.com/dependabot/cli/cmd/dependabot@latest
```
@asears
asears / sparkaqe.ini
Created December 2, 2023 11:58
Spark AQE Settings 2023
# https://docs.databricks.com/en/optimizations/aqe.html#configuration
# disable
# spark.databricks.optimizer.adaptive.enabled false
# default
spark.databricks.optimizer.adaptive.enabled true
# default number of partitions to use for shuffling data for joins or aggs
# for small files, set a lower shuffle number
# default
@asears
asears / configuration.dsc.yaml
Last active September 29, 2023 20:41
winget desired state config
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
# winget configure -f <C:/Users/<username>/winget-configs/config-file-name.dsc.yaml>
properties:
# assertions:
# - resource: Microsoft.Windows.Developer/OsVersion
# directives:
# description: Verify min OS version requirement
# allowPrerelease: true
# settings:
# MinVersion: '10.0.22000'
@asears
asears / bash_strict_mode.md
Created March 25, 2023 07:35 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation