Skip to content

Instantly share code, notes, and snippets.

View asears's full-sized avatar

Andrew Sears asears

View GitHub Profile
@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 / rollingpeaks.py
Last active October 27, 2023 00:13
rollingpeaks.py
# Define a window specification that partitions by date and orders by time
window_spec = Window.partitionBy("date").orderBy("time")
# Define a column that calculates the maximum value in a 30 minute window for each row
max_value = F.max("value").over(window_spec.rangeBetween(-1800, 0))
# Define a column that calculates the maximum value for each month
month_max = F.max("value").over(window_spec.rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing))
@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
@asears
asears / RUST.md
Last active March 25, 2023 15:51
Rust commands

rustc --version cargo --version

cargo install cargo-quickinstall

cargo quickinstall gitoxide

The default installation, 'max'

cargo install gitoxide

@asears
asears / spleet.cmd
Created September 27, 2022 16:13
Spleeter + Wav to MP3 Command File
@echo off
REM spleeter to convert to wav with 4 stems, convert to mp3 with minimal loss.
spleeter separate -p spleeter:4stems -o output %1
SET _file=%1
SET _folder=%_file:.mp3=%
SET _folder=%_folder:"=%
ECHO %_folder%
ffmpeg -vn -ar 44100 -ac 2 -b:a 192k "output\%_folder%\vocals.mp3" -i "output\%_folder%\vocals.wav"
ffmpeg -vn -ar 44100 -ac 2 -b:a 192k "output\%_folder%\bass.mp3" -i "output\%_folder%\bass.wav"
ffmpeg -vn -ar 44100 -ac 2 -b:a 192k "output\%_folder%\drums.mp3" -i "output\%_folder%\drums.wav"