Skip to content

Instantly share code, notes, and snippets.

@arianvp
arianvp / SSH_MACOS_SECURE_ENCLAVES.md
Last active December 27, 2025 04:55
Native Secure Enclaved backed ssh keys on MacOS

Native Secure Enclave backed ssh keys on MacOS

It turns out that MacOS Tahoe can generate and use secure-enclave backed SSH keys! This replaces projects like https://github.com/maxgoedjen/secretive

There is a shared library /usr/lib/ssh-keychain.dylib that traditionally has been used to add smartcard support to ssh by implementing PKCS11Provider interface. However since recently it also implements SecurityKeyProivder which supports loading keys directly from the secure enclave! SecurityKeyProvider is what is normally used to talk to FIDO2 devices (e.g. libfido2 can be used to talk to your Yubikey). However you can now use it to talk to your Secure Enclave instead!

@mborgerson
mborgerson / gist:69c0ac554db245e1073152dae049e2a1
Last active January 23, 2025 14:07
Installing Windows 10 on Apple MBP early 2013 (UEFI)

Boot camp assistant works great, but it will install Windows in legacy boot mode and will prevent access to integrated graphics. If you want to install with native UEFI access and permit integrated graphics, do this instead.

Mostly follow this guide: https://fgimian.github.io/blog/2016/03/12/installing-windows-10-on-a-mac-without-bootcamp/

EXCEPT: Do not use unetbootin to create your Windows USB image. Instead, use a Windows machine and create your bootable USB with Microsoft's USB installer tool. This will grab necessary installation files from the web, so don't bother with downloading an ISO ahead of time. After using the tool to prepare your USB drive, copy your 'Windows Support Software' to the USB drive.

@mgol
mgol / jquery-es6-example.md
Last active November 30, 2024 19:06
jQuery ES6 modules example usage

jQuery source is now authored using ES6 modules. It's possible to use them directly in the browser without any build process.

To test it locally, first clone the jQuery repository:

git clone git@github.com:jquery/jquery.git

Then, write the following index.html file:

@fousa
fousa / FairPlayer.swift
Last active June 1, 2023 12:28
Integrate HLS with FairPlay.
class FairPlayer: AVPlayer {
private let queue = DispatchQueue(label: "com.icapps.fairplay.queue")
func play(asset: AVURLAsset) {
// Set the resource loader delegate to this class. The `resourceLoader`'s delegate will be
// triggered when FairPlay handling is required.
asset.resourceLoader.setDelegate(self, queue: queue)
// Load the asset in the player.
@samthor
samthor / safari-nomodule.js
Last active September 19, 2025 16:07
Safari 10.1 `nomodule` support
// UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that
// does not support `nomodule` is probably not being used anywhere. The code below is left
// for posterity.
/**
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will
* load <script nomodule> anyway. This snippet solve this problem, but only for script
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script>
*
* Again: this will **not** prevent inline script, e.g.:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_adisk._tcp</type>
<txt-record>sys=waMa=0,adVF=0x100</txt-record>
<txt-record>dk0=adVN=Time Capsule,adVF=0x82</txt-record>
</service>
<service>
@andreaantonioni
andreaantonioni / ios-cell-registration-swift.md
Last active July 15, 2021 13:41 — forked from gonzalezreal/ios-cell-registration-swift.md
iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

A common task when developing iOS apps is to register custom cell subclasses for both UITableView and UICollectionView. Well, that is if you don’t use Storyboards, of course.

Both UITableView and UICollectionView offer a similar API to register custom cell classes:

public func register(_ cellClass: AnyClass?, forCellReuseIdentifier identifier: String)
public func register(_ nib: UINib?, forCellReuseIdentifier identifier: String)
@oliverbaptiste
oliverbaptiste / cardigans-gran-turismo-guitar-player.md
Created January 3, 2017 06:17
A Track-by-Track Tour of The Cardigans' Gran Turismo

A Track-by-Track Tour of The Cardigans' Gran Turismo

By Kyle Swenson
Guitar Player, January 1999

Swedish popsters the Cardigans dumped an earful of sugar on the world with their 1997 smash hit, "Lovefool." Based on the song''s sparse guitars and bubble-gum chorus, you probably wouldn''t think of the band as raving experimentalists. But the Cardigan''s fourth album, Gran Turismo [Mercury], is a revelation of strange and rather unexpected guitar sounds. For example, you might think you''re hearing a guitar synth, a harpischord, or a pedal synth, a harpischord, or a pedal steel, but you''re not. All of the album''s sounds are production tricks conjured by guitarist Peter Svensson and producer Tore Johansson.

What's more, not one guitar track on Turismo was recorded using an amp. The guitars were either recorded direct or processed through Line 6's Amp Farm plug-in for Digidesign's Pro Tools. (For a full product review on Amp Farm, see "Virtual Vintage" in the Nov. '98 GP.) And although Amp Farm can de

@herrernst
herrernst / .fonts.conf
Created July 25, 2016 09:20 — forked from anonymous/.fonts.conf
Reduce hinting amount for fonts on linux
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM '/etc/fonts/fonts.dtd'>
<fontconfig>
<match target="font">
<edit name="hintstyle" mode="assign">
<const>hintslight</const>
</edit>
</match>
</fontconfig>
anonymous
anonymous / .fonts.conf
Created January 20, 2016 16:39
Reduce hinting amount for fonts on linux
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM '/etc/fonts/fonts.dtd'>
<fontconfig>
<match target="font">
<edit name="hintstyle" mode="assign">
<const>hintslight</const>
</edit>
</match>
</fontconfig>