Skip to content

Instantly share code, notes, and snippets.

View tylerszabo's full-sized avatar

Tyler Szabo tylerszabo

View GitHub Profile
@tylerszabo
tylerszabo / Get-DiskInfo.ps1
Created November 29, 2017 06:56
Long one-liner to display disk information
Get-Partition | % { $Volume = if ($_.AccessPaths) { Get-Volume -Path $_.AccessPaths[-1] } else { @{} } ; $_ | Add-Member -Type NoteProperty -Name "Label" -Value $Volume.FileSystemLabel -PassThru | Add-Member -Type NoteProperty -Name "FileSystem" -Value $Volume.FileSystemType -PassThru } | Format-Table -GroupBy "DiskId" -Property @("DiskNumber", "PartitionNumber", "DriveLetter", "Label", "Size", "FileSystem", "Type", "AccessPaths")
@echo off
"%ProgramFiles%\Blender Foundation\Blender\blender.exe" "%1" --background --python "%~dp0\blend2txt.py" 2>NUL
Invoke-WebRequest -Uri "https://cygwin.com/setup-x86_64.exe" -OutFile "C:\tools\cygwin\cygwinsetup.exe" -ErrorAction Stop
@tylerszabo
tylerszabo / pre-commit
Created April 25, 2018 03:22
Pre-commit hook for catching "FIXME"
#!/bin/sh
#
# Prevent "FIXME" from appearing in diffs
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
@tylerszabo
tylerszabo / gvim-cygwin-launcher.sh
Last active October 22, 2019 13:30
Launch GVim from Cygwin
#!/bin/bash
# Copyright (C) 2018-2019 Tyler Szabo
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# See <http://www.gnu.org/licenses/>.
TEMPFILE_NAME=gvim-`date +%s`-${RANDOM}.bat
TEMPFILE=$TMP/$TEMPFILE_NAME
TEMPFILE_W=`cygpath --windows --absolute --long-name "$TEMPFILE"`
@tylerszabo
tylerszabo / PCPartPicker_Monitor_Ratio.js
Created August 7, 2018 08:35
Display decimal aspect ratio for monitor ratios
$("ul#a_set.filter-list > li > label").toArray().forEach(function(el)
{
var ratio = el.innerText.split(":").map(x => parseInt(x));
var result = (ratio[0] / ratio[1]).toFixed(2)
el.innerText = (el.innerText + " " + (result > 0 ? "(" + result + ")" : ""));
});

Keybase proof

I hereby claim:

  • I am tylerszabo on github.
  • I am tszabo (https://keybase.io/tszabo) on keybase.
  • I have a public key ASCqlzaVG8sstfeOt61fqfAXPnfNLLY3Nu9PAUS3NXSh1wo

To claim this, I am signing this object:

#!/bin/sh
# Copyright (C) 2019 Tyler Szabo
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# See <http://www.gnu.org/licenses/>.
# Copy to a directory in your PATH and rename to git-mirror (without an extensions)
USAGE='[-f] [--from=<remote-name>] <repo> [<dir>]'
@tylerszabo
tylerszabo / make_test_metadata_mp3.sh
Last active October 4, 2020 21:00
Set MP3 Metadata with FFMPEG
#!/bin/sh
# https://id3.org/id3v2.4.0-frames
# https://id3.org/id3v2.4.0-structure
Title="The Song Title"
TrackArtist="The Track Artist"
AlbumArtist="The Album Artists"
AlbumTitle="The Album Title"
Genre="(60)Top 40"
#!/bin/sh
set -e
DESTINATION=/usr/local/bin/docker-compose
RELEASE=$(curl --head https://github.com/docker/compose/releases/latest 2>/dev/null | sed -ne 's,^location: https://github.com/docker/compose/releases/tag/\([^[:space:]]\+\).*$,\1,p')
URL="https://github.com/docker/compose/releases/download/${RELEASE}/docker-compose-$(uname -s)-$(uname -m)"
REAL_BIN=/usr/local/bin/docker-compose.${RELEASE}