Plugin | Description |
---|---|
editor-width-slider | Adjust how wide the editor view is |
table-editor-obsidian | Edit tables! |
obsidian-editor-shortcuts | Sublime-esque shortcuts, sometimes broke tho. |
obsidian-sortable | Sort things? I don’t quite remember |
obsidian-linter | MUST-HAVE. Lint plain text is so so nice. Saves a ton of time formatting extra line breaks. |
obsidian-style-settings | Extra themeing |
obsidian-git | Backup the vault using Git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct LoadingViewModifier: ViewModifier { | |
@Binding var isLoading: Bool | |
func body(content: Content) -> some View { | |
content | |
.overlay( | |
// Wrapping this in a `Group` fixes the error | |
if isLoading { | |
ProgressView() | |
.transition(.opacity) // <-- error: Branches have mismatching types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Apply a background to all cells in a GridRow, with rounded corners. | |
/// | |
/// Example: | |
/// ```swift | |
/// Grid(/* ... */) { | |
/// ForEach(...) { element in | |
/// GridRow(alignment: .center) { | |
/// Text(element.title) | |
/// .modifier(FilledBackgroundModifier( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generic version of https://gist.github.com/chriseidhof/5ff6ef8786f5635c18b20304ab9d9b01 | |
extension View { | |
/// Convenience for setting a `_ViewTraitKey` | |
func withTrait<Trait, Value>(_: Trait.Type, value: Value) -> some View | |
where Trait: _ViewTraitKey, Value == Trait.Value | |
{ | |
_trait(Trait.self, value) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CoreLocation | |
import Foundation | |
class LocationManager: NSObject, ObservableObject, CLLocationManagerDelegate { | |
static let shared: LocationManager = .init() | |
@Published var userCoordinates: UserCoordinates? | |
private let clLocationManager = CLLocationManager() | |
@Published var locationPermissions: LocationPermissionStatus = .unknown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct RSFile { | |
var name: String | |
} | |
func importfiles(fileURLs: [URL]) async -> [RSFile] { | |
var files = [RSFile]() | |
for fileURL in fileURLs { | |
let fileData: URLResourceValues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TransferablePersistentID.swift | |
// Cabinette | |
// | |
// Created by Peter Kos on 3/1/24. | |
// | |
import CoreTransferable | |
import SwiftData | |
import UniformTypeIdentifiers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct DebugPosition: ViewModifier { | |
var position: CGPoint | |
func body(content: Content) -> some View { | |
content | |
.overlay(alignment: .bottom) { | |
ZStack { | |
Text("(\(Int(position.x)), \(Int(position.y)))") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Zola | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
# Allows a manual run from the Actions tab | |
workflow_dispatch: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct OptionalComparator<T: Comparable>: SortComparator { | |
typealias Compared = T? | |
var order: SortOrder = .forward | |
func compare(_ lhs: T?, _ rhs: T?) -> ComparisonResult { | |
return switch (lhs, rhs) { | |
case (_, nil): | |
order == .forward ? .orderedDescending : .orderedAscending | |
default: | |
order == .forward ? .orderedAscending : .orderedDescending |
NewerOlder