Skip to content

Instantly share code, notes, and snippets.

@jonathanduke
jonathanduke / git-squash-history.sh
Last active January 27, 2021 21:52
Squash historical commits, leaving only the last 30 days of history, without harming the current worktree
###
## Based on: https://gist.github.com/jonathanduke/020d97409396e784a2db84f178c8b907#file-git-squash-history-sh
## Public domain: http://unlicense.org/
## Modify as you wish, but you are encouraged to leave this comment for future reference in case the original is updated.
###
# Use at your own risk! To make sure you know what you're doing, "origin" and "master" have been replaced with different names.
git checkout -B TEMPhead
git worktree add --checkout -B TEMPstart _TEMPworktree TEMPhead~30 # goes back 30 commits (or manually specify your own branch)
cd _TEMPworktree
@jonathanduke
jonathanduke / DriveImageXmlAttrib.xsl
Created August 6, 2020 15:24
This XSLT can be applied to a DriveImage XML file to create a batch file that will reapply the file attributes (hidden, system, read only, etc.) after extracting files from Browse mode.
<?xml version="1.0" encoding="utf-8"?>
<!--
Based on: https://gist.github.com/jonathanduke/27f440de0ddb764b88194771be4564e8#file-driveimagexmlattrib-xsl
Applies to: https://www.runtime.org/driveimage-xml.htm
Public domain: http://unlicense.org/
Modify as you wish, but you are encouraged to leave this comment for future reference in case the original is updated.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:template match="/">
@jonathanduke
jonathanduke / BuildAssemblyInfo.targets
Last active September 27, 2023 17:43
Build targets for Visual Studio to automatically include Git commit hash and other build metadata in assembly info
<!--
Based on: https://gist.github.com/jonathanduke/ab4fc1880e8b245d3f939b122f301938#file-buildassemblyinfo-targets
Dependent on: https://gist.github.com/jonathanduke/ab4fc1880e8b245d3f939b122f301938#file-gitbuildprops-targets
Public domain: http://unlicense.org/
Modify as you wish, but you are encouraged to leave this comment for future reference in case the original is updated.
-->
<Project>
<Import Project="GitBuildProps.targets" />

Keybase proof

I hereby claim:

  • I am jonathanduke on github.
  • I am jonathanduke (https://keybase.io/jonathanduke) on keybase.
  • I have a public key whose fingerprint is 0AF9 932B 0F4F 2ED1 8B7A 01E4 25C1 F8BD 1D9E 81CD

To claim this, I am signing this object: