Skip to content

Instantly share code, notes, and snippets.

View olejorgensen's full-sized avatar
💾

Ole Jørgensen olejorgensen

💾
  • København, Danmark
View GitHub Profile
@olejorgensen
olejorgensen / delete-windows-old-folder.ps1
Last active July 17, 2021 07:30
Delete the Windows.old folder
<#
The sample scripts are not supported under any Microsoft standard support
program or service. The sample scripts are provided AS IS without warranty
of any kind. Microsoft further disclaims all implied warranties including,
without limitation, any implied warranties of merchantability or of fitness for
a particular purpose. The entire risk arising out of the use or performance of
the sample scripts and documentation remains with you. In no event shall
Microsoft, its authors, or anyone else involved in the creation, production, or
delivery of the scripts be liable for any damages whatsoever (including,
without limitation, damages for loss of business profits, business interruption,
@olejorgensen
olejorgensen / Array+Extensions.swift
Last active January 13, 2024 16:28
MapKit and CoreLocation extensions
import Foundation
extension Array where Element: Hashable {
var uniques: Array {
return Array(Set<Element>(self))
}
}
@olejorgensen
olejorgensen / BaseService.swift
Last active September 19, 2021 19:13
Swift Json Service Template
import Foundation
import Combine
protocol JsonServiceProtocol {
var decoder: JSONDecoder { get }
var errorPublisher: PassthroughSubject<Error, Never> { get }
func publish(err: Error)
}
class BaseService: NSObject, JsonServiceProtocol {
@olejorgensen
olejorgensen / App.cs
Last active December 1, 2022 06:20
portable application settings
public partial class App : YourApp
{
private static SettingsManager Manager = new SettingsManager("./settings.json");
public static Settings Settings { get { return Manager.Settings; } }
...
}