Skip to content

Instantly share code, notes, and snippets.

@asears
asears / kdiff3-config.md
Created November 2, 2024 12:57 — forked from JeffMill/kdiff3-config.md
kdiff3 configuration for Windows

KDiff3

Fast on Linux and Windows, and supports 3-way merging! Diffinity and Meld are a couple of other viable options.

KDiff3 Merge Tutorial

Install KDiff3

winget install KDE.KDiff3
@asears
asears / Setup-Windows11-VM.ps1
Created November 2, 2024 12:57
Run Windows 11 in VM
#requires -RunAsAdministrator
# .\Setup-Windows11-VM.ps1 -VMName 'W11' -SwitchName 'Default Switch' -ISOFile 'C:\Users\jeffmill\Downloads\ISO\Windows 11 - Version 22H2.iso' -VMPath 'E:\VM'
Param(
# Virtual Machine Name
[Parameter(Mandatory = $true)][string]$VMName,
# Virtual Switch to be used - see Get-VMSwitch
[Parameter(Mandatory = $true)][string]$SwitchName,
# Full path for the install media (ISO file)
@asears
asears / WordAutomation-Threaded.ps1
Created November 2, 2024 12:55 — forked from JeffMill/WordAutomation-Threaded.ps1
Automate word (threaded)
$ScriptBlock =
{
Param([int]$RunNumber)
$filename = Join-Path ([IO.Path]::GetTempPath()) "powershell-$RunNumber.doc"
'Opening Word ...'
$oWord = New-Object -Com Word.Application
$oWord.Visible = $true
@asears
asears / ripgrep-cheat-sheet.md
Created November 2, 2024 12:50
RipGrep (rg) Cheat Sheet
Command Description
rg pattern Search pattern in current dir recursively
rg pattern utils.py Search in a single file utils.py
rg pattern src/ Search in dir src/ recursively
rg '^We' test.txt Regex searching support (lines starting with We)
rg -F '(test)' Search literally, i.e., without using regular expression
rg -i pattern Search pattern and ignore case (case-insensitive search)
rg -S pattern Smart case search (match case of pattern)
rg pattern -g '*.py' File globbing (search in certain files), can be used multiple times
@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 / export_issues.py
Created October 8, 2021 09:43 — forked from reberhardt7/export_issues.py
Github Issues Export: This script exports all issues from a repository, along with comments and events, into a JSON file. It also produces a Markdown file that can be used to easily view the issues.
"""
This script uses Github's API V3 with Basic Authentication to export issues from
a repository. The script saves a json file with all of the information from the
API for issues, comments, and events (on the issues), downloads all of the
images attached to issues, and generates a markdown file that can be rendered
into a basic HTML page crudely mimicking Github's issue page. If the gfm module
is available, the script will go ahead and render it itself.
In the end, you'll be left with a folder containing a raw .json file (which you
can use to extract information for your needs, or to import it somewhere else),
@asears
asears / wget.sh
Created December 30, 2020 14:18 — forked from crittermike/wget.sh
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@asears
asears / gpg_git_signing.md
Last active April 9, 2020 11:23 — forked from alopresto/gpg_git_signing.md
Steps to enable GPG signing of git commits.

On windows, git config --global gpg.program "C:\Program Files (x86)\GnuPG\bin\gpg.exe"

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
@asears
asears / tmux-cheatsheet.markdown
Created February 24, 2020 03:51 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@asears
asears / gen_video_interpolation.py
Created February 13, 2020 02:14 — forked from lzhbrian/gen_video_interpolation.py
generate interpolation video from stylegan2
"""
Author: lzhbrian (https://lzhbrian.me)
Date: 2020.1.20
Note: mainly modified from: https://github.com/tkarras/progressive_growing_of_gans/blob/master/util_scripts.py#L50
"""
import numpy as np
from PIL import Image
import os
import scipy