Skip to content

Instantly share code, notes, and snippets.

@DaneWeber
DaneWeber / MacOS_Catalina_ISO.sh
Last active May 6, 2022
Create a MacOS Catalina install ISO
View MacOS_Catalina_ISO.sh
# Download the installer for MacOS Catalina
softwareupdate --fetch-full-installer --full-installer-version 10.15.7
# Create a directory for the VM installer
cd ~/
mkdir VMs
cd VMs
mkdir installers
cd installers
@DaneWeber
DaneWeber / MacOS_Monterey_ISO.sh
Created May 4, 2022
Create a MacOS Monterey install ISO
View MacOS_Monterey_ISO.sh
# Download the installer for MacOS Monterey
softwareupdate --fetch-full-installer --full-installer-version 12.3.1
# Create a directory for the VM installer
cd ~/
mkdir VMs
cd VMs
mkdir installers
cd installers
@DaneWeber
DaneWeber / Brewfile
Created Mar 16, 2021
Sample Brewfile
View Brewfile
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
cask "docker"
cask "iterm2"
cask "visual-studio-code"
@DaneWeber
DaneWeber / Brewfile
Created Mar 15, 2021
Gentle idempotent Mac dev setup
View Brewfile
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
cask "docker"
cask "iterm2"
cask "visual-studio-code"
@DaneWeber
DaneWeber / IncidentResponse.md
Created Jan 6, 2021
Notes on incident response
View IncidentResponse.md

Incident Response

One incident response approach:

  • ChatOps
    • Time-stamped record of actions taken.
    • Transparent for any interested party to review.
    • Reduces need to answer questions about status and next steps.
    • Can integrate with alerts and more advanced bots.
  • Incident Commander
View keybase.md

Keybase proof

I hereby claim:

  • I am daneweber on github.
  • I am daneweber (https://keybase.io/daneweber) on keybase.
  • I have a public key ASDj2P-TIqdncADPOvVRgUqIFcKQqqx-gSkL60Vs1O03kgo

To claim this, I am signing this object:

@DaneWeber
DaneWeber / dateToJSON.spec.js
Created Sep 24, 2019
ISO8601 date & time with offset for Javascript
View dateToJSON.spec.js
import "./dateToJSON";
// This spec file should be exercised in various timezones. Set the timezone in the container with
// docker exec -it -e TZ=Pacific/Chatham cmd
// Or interactively with commands like the following:
// echo "Pacific/Niue" > /etc/timezone
// dpkg-reconfigure tzdata
// date
@DaneWeber
DaneWeber / create-minecraft-sync-task.ps1
Created Sep 10, 2018
Sync Minecraft saves via cloud syncing solution like OneDrive
View create-minecraft-sync-task.ps1
$syncScript = $PSScriptRoot + "\sync-minecraft-saves.ps1"
$minuteRepeat = 10
schtasks /create /sc minute /mo $minuteRepeat /ru System /tn "Minecraft Save Sync" /tr "powershell.exe -NoLogo -WindowStyle hidden -file $syncScript"
@DaneWeber
DaneWeber / nightRoute.rb
Created Aug 2, 2018
2018-08-02 Bits, Please! Code Fight
View nightRoute.rb
def nightRoute(city)
final = city.length - 1
hops = {}
hops[0] = city[0].each_with_index.map{ |length, island| length == -1 ? nil : [0, island] }.compact
(1..final).each do |iter|
hops[iter] = hops[iter - 1].map do |path|
if path[-1] == final
nil
else
city[path[-1]].each_with_index.map do |length, island|
@DaneWeber
DaneWeber / perfectCity.rb
Created Jul 26, 2018
2018-07-26 Bits, Please! Code Fight
View perfectCity.rb
def perfectCity(departure, destination)
diff(departure[0], destination[0]) + diff(departure[1], destination[1])
end
def diff(dep, dest)
naiveDiff = (dep - dest).abs
extraDiff = 0
if dep.ceil == dest.ceil
lower, higher = [dep, dest].sort
extraDiff = [lower - lower.floor, higher.ceil - higher].min * 2