Skip to content

Instantly share code, notes, and snippets.

View florianpircher's full-sized avatar

Florian Pircher florianpircher

View GitHub Profile
import Foundation
public enum PropertyList {
case string(String)
case data(ContiguousArray<UInt8>)
case array([PropertyList])
case dictionary([String: PropertyList])
}
let data = try Data(contentsOf: URL(fileURLWithPath: "/Users/Florian/Desktop/File.plist"))
import Foundation
public enum PropertyList {
case string(String)
case data(ContiguousArray<UInt8>)
case array([PropertyList])
case dictionary([String: PropertyList])
}
let data = try Data(contentsOf: URL(fileURLWithPath: "Path/To/File.plist"))
<?php
//
// OpenStep Property List Parser
//
// Copyright 2024 Florian Pircher
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@florianpircher
florianpircher / Fonts.swift
Created March 7, 2024 20:21
NSFont extensions for setting OpenType features and variation axes
//
// Fonts.swift
//
// Copyright 2021 Florian Pircher
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
@florianpircher
florianpircher / README.md
Created October 27, 2022 23:11 — forked from technic/README.md
change font linespacing for dummy editor #linux #ttf #qtcreator

How to change font linespacing

Manual

You need to manipulate a ttf file. I found such a script that comes with Input font at http://input.fontbureau.com. So we copy DejaVuSansMono ttf files to ~/.fonts/ and create a new font DejaVuSansMonoH. I changed line 147, to match this font name, and run

extension Sequence {
func sorted<SortKey>(
by areInIncreasingOrder: (SortKey, SortKey) throws -> Bool,
sortKey makeSortKey: (Element) throws -> SortKey
) rethrows -> [Element] {
try self
.map { (key: try makeSortKey($0), element: $0) }
.sorted { try areInIncreasingOrder($0.key, $1.key) }
.map { $0.element }
}
@florianpircher
florianpircher / PreferencesTabViewController.swift
Last active August 30, 2022 18:59
A drop-in replacement for a plain NSTabViewController that animates size changes of the preferences window when selecting a different tab.
//
// PreferencesTabViewController.swift
// Light Table
//
// Copyright 2022 Florian Pircher
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
@florianpircher
florianpircher / README.md
Created March 5, 2022 23:21 — forked from IsaacXen/README.md
(Almost) Every WWDC videos download links for aria2c.
@florianpircher
florianpircher / User Defaults Property Wrappers.swift
Last active January 15, 2022 21:00
Property wrappers for user defaults. For user defaults publishers, see: https://gist.github.com/florianpircher/4513f8def656fc4fe427345bce7b052b
//
// User Defaults Property Wrappers.swift
//
// Copyright 2021 Florian Pircher
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
@florianpircher
florianpircher / User Defaults Publishers.swift
Last active April 14, 2023 16:06
Combine publishers for user defaults. For user defaults property wrappers, see: https://gist.github.com/florianpircher/626174760c2d91bab6defbf1b2b3d4cf
//
// User Defaults Publishers.swift
// Light Table
//
// Copyright 2021 Florian Pircher
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//