Skip to content

Instantly share code, notes, and snippets.

View Austinate's full-sized avatar

Ostap Austinate

View GitHub Profile
import SwiftUI
// This is an example of how to keep the ObservableObjects near the root of the view hierarchy
// and dispatch actions from any view easily without having to pass too many things down. This
// helps keep the views simple and makes previews a lot easier.
//
// This is inspired from what Apple is doing with `DismissAction`, `OpenURLAction`, `OpenWindowAction`, etc...
// The following is a very simple example with only two view-levels and we could pass closures directly,
import Foundation
public enum Platform {
case iOS
case iOSOnMac
case mac
}
public func execute(if condition: Bool, _ action: () -> Void) {
if condition {
@simonbs
simonbs / XcodeReleases.js
Last active November 14, 2022 01:50
Sample app that lets you browse Xcode releases. Depends on ScriptUI, my yet-to-be-releases project for building native SwiftUI interfaces in JavaScript.
UI.view = RootView()
function RootView() {
const [isLoading, setLoading] = createSignal(true)
const [xcodeGroups, setXcodeGroups] = createSignal([])
fetchXcodes().then((xcodes) => {
setLoading(false)
setXcodeGroups(groupXcodes(xcodes))
})
@pjobson
pjobson / exfat.md
Last active June 21, 2024 20:31
Create exFat Partiion in Linux Accessible to Windows / MacOS

To create a exFat partition which is compatible with all operating systems, I recommend using a drive with under 2TB. This will allow you to use an MBR partition table instead of GPT, I've had issues mounting GPT exFat drives in Windows.
This could be partially because I don't know how to Windows anything.

List Disks

fdisk -l

Mine for example is /dev/sdl, because I have many disks.

@mchoi2000
mchoi2000 / LICENSE
Last active December 13, 2023 11:05
Simplemaps: World Cities Database
This license is a legal document designed to protect your rights and the rights of the Pareto Software, LLC, the owner of Simplemaps.com. Please read it carefully. Purchasing or downloading a data product constitutes acceptance of this license.
Description of Product and Parties: This license is a contract between you (hereafter, the Customer) and Pareto Software, LLC (hereafter, the Provider) regarding the use and/or sale of an collection of geographic data (hereafter, the Database).
Ownership of Database: All rights to the Database are owned by the Provider. The Database is a cleaned and curated collection of geographic facts and the Provider retains all rights to the Database afforded by the law. Ownership of any intellectual property generated by the Provider while performing custom modifications to the Database for a Customer (with or without payment) is retained by the Provider.
License: Customers who purchase a license are allowed to use the database for projects that benefit their organization or t
public final class Stopwatch {
var start: DispatchTime = .now()
let maxTime: TimeInterval
let measurementTitle: String
private var isReportedAtLeastOnce = false
@discardableResult
static func create(title: String = #function, maxTime: TimeInterval = 0) -> Stopwatch {
@rudotriton
rudotriton / scriptable-calendar-widget.md
Last active August 8, 2023 14:35
Customizable iOS Calendar widget in Scriptable

Scriptable Calendar Widget

scriptable calendar

For ease of maintainability this project has moved from this gist to its own repository. You can go and visit it there.

@marco79cgn
marco79cgn / spotify-now-playing.js
Last active June 20, 2024 09:56
A Scriptable iOS widget that shows what‘s playing on Spotify
let spotifyCredentials
let widget = await createWidget()
Script.setWidget(widget)
Script.complete()
async function createWidget() {
let widget = new ListWidget()
let spotifyIcon = await getImage("spotify-icon.png")
widget.backgroundColor = new Color("1e2040")
@mzeryck
mzeryck / mz_invisible_widget.js
Last active May 7, 2024 02:23
A Scriptable script that creates "invisible" widget backgrounds based on your iOS wallpaper, and then either uses them as a Scriptable widget background or exports to your camera roll.
/*
MIT License
Copyright (c) 2022 Maxwell Zeryck
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTW
@DreamingInBinary
DreamingInBinary / Best in Class iOS Checklist
Last active January 29, 2024 18:18
This is a public checklist updated every year after the latest version of iOS and iPadOS are shipped. It's a boiled down version of a "Best in Class" app checklist created by Jordan Morgan.
# A Best in Class Checklist
A boiled down checklist adapted from this [post](https://www.swiftjectivec.com/a-best-in-class-app/), created by @jordanmorgan10.
> To use this, create a Github Issue in your own repo, and simply copy and paste this text.
## iOS Core Technology
_Things any iOS app can benefit from_
- [ ] iCloud Sync
- [ ] Focus Filter Support