Skip to content

Instantly share code, notes, and snippets.

## To change an arbitrary commit (rewrites all future commits too)
git rebase <commitSHA>^ -i
# or, for first commit:
git rebase -i --root
+ Replace pick with e (edit) on the line with that commit (the first one)
+ quit the editor
git commit --amend --no-edit
git rebase --continue
## To amend commit details of last commit
@dseeley
dseeley / deltemp.bat
Created June 12, 2021 07:26
Recursively delete windows temporary files.
CD /D %Temp%
DEL /Q /F *.* >NUL
FOR /D %%i in (*) DO RMDIR /S /Q "%%i" >NUL
CD /D C:\TEMP
DEL /Q /F *.* >NUL
FOR /D %%i in (*) DO RMDIR /S /Q "%%i" >NUL
CD /D C:\WINDOWS\TEMP
DEL /Q /F *.* >NUL
@dseeley
dseeley / systemd_shutdown_with_network.sh
Last active May 10, 2020 16:11
bash systemd shutdown script with networking
[Unit]
Description=pre-shutdown activities with networking
Requires=network-online.target network.target dbus.service nss-lookup.target
After=network-online.target network.target dbus.service nss-lookup.target
[Service]
Type=simple
ExecStart=/opt/preshutdown.sh
TimeoutStopSec=120
SendSIGKILL=no
Sub DeleteFutureWeeklyOcurrences()
Dim objAppointment As Outlook.AppointmentItem
Dim objRecurrencePattern As Outlook.RecurrencePattern
Dim objOccurrence As Outlook.AppointmentItem
Dim occurrenceCount As Integer
Set objAppointment = Application.ActiveExplorer.Selection.Item(1)
If objAppointment.IsRecurring Then
Set objRecurrencePattern = objAppointment.GetRecurrencePattern