Skip to content

Instantly share code, notes, and snippets.

View DenisFrezzato's full-sized avatar

Denis Frezzato DenisFrezzato

View GitHub Profile
@DenisFrezzato
DenisFrezzato / vm-vb-mac.sh
Last active March 9, 2024 22:25
Configuration script for a Mac OS X VirtualBox virtual machine.
# The first parameter is the name of the virtual machine.
# @see https://medium.com/@twister.mr/installing-macos-to-virtualbox-1fcc5cf22801
# @see https://techsviewer.com/how-to-install-mac-os-x-el-capitan-on-pc-on-virtualbox/
VBoxManage modifyvm "$1" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "$1" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "$1" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "$1" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "$1" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "$1" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
@DenisFrezzato
DenisFrezzato / programmer-dvorak-keyboard-layout.sh
Last active November 23, 2018 16:01
Programmer Dvorak keyboard layout
#!/bin/sh
setxkbmap -layout us -variant dvp -option compose:ralt -option numpad:shift3 -option kpdl:semi -option keypad:atm -option caps:shift
@DenisFrezzato
DenisFrezzato / money.ts
Last active July 1, 2020 15:31
Physical quantities with branded types. Example with monetary values.
type Branded<P, B> = P & { readonly _brand: B }
type PhysicalQuantity<Q, U> = Branded<number, Q> & U
type Currency<C> = PhysicalQuantity<'Currency', C>
type EUR_ = { readonly EUR: unique symbol }
type EUR = Currency<EUR_>
type USD_ = { readonly USD: unique symbol }
type USD = Currency<USD_>

Keybase proof

I hereby claim:

To claim this, I am signing this object: