Skip to content

Instantly share code, notes, and snippets.

View holstvoogd's full-sized avatar
😶
quite

Arthur holstvoogd

😶
quite
View GitHub Profile
@holstvoogd
holstvoogd / chat.md
Last active March 13, 2023 08:09
ChatGPT invoice numbers concern

write a concern to add a garantueed unique and sequential invoice number to an active record model

Here is an example of a concern that adds a guaranteed unique and sequential invoice number to an ActiveRecord model:

module InvoiceNumberable
  extend ActiveSupport::Concern

  included do
 before_create :generate_invoice_number
@holstvoogd
holstvoogd / remap.sh
Created July 30, 2019 15:21
swap crtl & fn + capslock remap
defaults -currentHost write -g com.apple.keyboard.modifiermapping.alt_handler_id-50 -array \ []
'<dict><key>HIDKeyboardModifierMappingDst</key><integer>30064771300</integer><key>HIDKeyboardModifierMappingSrc</key><integer>30064771129</integer></dict>' \
'<dict><key>HIDKeyboardModifierMappingDst</key><integer>1095216660483</integer><key>HIDKeyboardModifierMappingSrc</key><integer>30064771300</integer></dict>' \
'<dict><key>HIDKeyboardModifierMappingDst</key><integer>280379760050179</integer><key>HIDKeyboardModifierMappingSrc</key><integer>30064771296</integer></dict>' \
'<dict><key>HIDKeyboardModifierMappingDst</key><integer>30064771300</integer><key>HIDKeyboardModifierMappingSrc</key><integer>1095216660483</integer></dict>' \
'<dict><key>HIDKeyboardModifierMappi
@holstvoogd
holstvoogd / prune-log-stream.sh
Created August 10, 2018 15:06
Removes empty log streams from a given log group
#!/bin/bash
loggroup=$1
dryrun=$2
if [[ -z $loggroup || $loggroup == '--dryrun' ]]; then
echo "Usage: $0 LogGroup [--dryrun]"
exit 1
fi
@holstvoogd
holstvoogd / disable.sh
Created April 9, 2018 11:48
Disable bunch of #$!@ in Sierra (Version 2.1)
#!/bin/bash
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# Agents to disable
TODISABLE=('com.apple.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' 'com.apple.familycircled' 'com.apple.familycontrols.useragent' 'com.apple.familynotificationd' 'com.apple.gamed' 'com.apple.icloud.findmydeviced.findmydevi