Skip to content

Instantly share code, notes, and snippets.

@Nejat
Nejat / install-rustup
Created March 4, 2025 18:03
lets you install archived versions of rustup for any supported target
#!/usr/bin/env zsh
if [[ $1 =~ "-help|-h" ]]; then
echo
echo "usage: ./install-rustup [version] [target]"
echo
exit
fi
@Nejat
Nejat / setup-bevy-0.15-project-for-android.sh
Last active February 18, 2025 07:44 — forked from hortonew/setup-bevy-0.15-project-for-android.sh
setup-bevy-0.15-project-for-android.sh
#!/usr/bin/env zsh
PROJECT="${1:-bevy_breakout_15}"
BEVY_VERSION="0.15.2"
echo "setting up $PROJECT ..."
cargo new $PROJECT --bin
cd $PROJECT
@Nejat
Nejat / Cargo.toml
Created January 10, 2025 18:48
general rust crate clippy and profile settings
[workspace.lints.clippy]
cargo = { priority = -1, level = "deny" }
correctness = { priority = -1, level = "deny" }
complexity = { priority = -1, level = "deny" }
nursery = { priority = -1, level = "deny" }
pedantic = { priority = -1, level = "deny" }
perf = { priority = -1, level = "deny" }
style = { priority = -1, level = "deny" }
suspicious = { priority = -1, level = "deny" }
"$schema" = 'https://starship.rs/config-schema.json'
format = """
[](color_orange)\
$os\
$username\
[](bg:color_yellow fg:color_orange)\
$directory\
[](fg:color_yellow bg:color_aqua)\
$git_branch\
@Nejat
Nejat / winget-updates.nu
Last active April 6, 2024 04:44
Lists and optionally upgrades available WinGet updates. Skips Unknown versions or anything in the skip list
# winget-updates.nu
# GitHub Gists
# this script - https://gist.github.com/Nejat/06c275749b7931857bb4c7604a026877
# example skip config - https://gist.github.com/Nejat/5a41fe09bb27c1bbcf345fb1dea8a234
# powersheel version - https://gist.github.com/Nejat/6cb42f098320cb2fcb57a4e1728ca29e
# output formatting constants
const err_color: string = 'light_red'
const fail_color: string = 'red'
@Nejat
Nejat / pre-commit-rust
Created December 4, 2022 09:57
git pre-commit hook for rust projects
#!/bin/sh
set -eu
# if ! cargo fmt -- --check
# then
# echo "check/fix fmt issues ..."
# exit -1
# fi
@Nejat
Nejat / wngt-cfg
Last active September 22, 2022 08:27
Unity # use unity hub to manage versions of unitywinget
Citrix Workspace # need the installed version
Visual Studio Community* # use visual studio installer
PowerToys (Preview) # does not update correctly
Microsoft .NET SDK # does not update correctly
Microsoft Visual C++ # use visual studio installer
Windows Software Development Kit # use visual studio installer
JetBrains # use jetbrains toolbox
@Nejat
Nejat / msys2-setup.ps1
Last active October 16, 2021 01:36
installs MSys2 or refreshes an existing installation using winget; updates pacman, and optionally executes additional bash setup commands
param (
# provide a list of addition bash setup commands to invoke
[string] $additional = "msys2-additional-setup",
# true teardown existing installations, false to stop if installation exists
[switch] $refresh = $false
)
# constant defining MSys2 winget package name
[string] $package = "MSys2"
# checks to see if an installaiton already exists
@Nejat
Nejat / msys2-additional-setup
Last active July 27, 2021 19:07
additional bash setup commands to use when setting up MSys2 with msys2-setup.ps1
pacman -S --needed base-devel mingw-w64-x86_64-toolchain | Development Toolchain
pacman -S --needed mingw-w64-x86_64-meson | Meson
pacman -S --needed mingw-w64-x86_64-vulkan-devel | Vulkan Development Tools
pacman -S --needed mingw-w64-x86_64-gtk3 | GTK3 Development Tools
pacman -S --needed mingw-w64-x86_64-gtk4 | GTK4 Development Tools
pacman -S --needed mingw-w64-x86_64-glade | GTK GLade Interface Designer
@Nejat
Nejat / winget-updates.ps1
Last active March 30, 2025 16:32
Lists and optionally upgrades available updates. Skips Unknown versions or anything in the skip list
param(
# provide a configuration file to define package handling
[string] $skipFile = "wngt-cfg",
# true to upgrade eligible packages, false dry run
[switch] $upgrade = $false
)
# adjust buffer size of output, really don't know if this helps ¯\_(ツ)_/¯
if ($Host -and $Host.UI -and $Host.UI.RawUI) {
$rawUI = $Host.UI.RawUI