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
tell application "Reminders" | |
set listNames to {} | |
repeat with aList in lists | |
copy name of aList to end of listNames | |
end repeat | |
set listName to choose from list listNames with prompt "Select the list to print:" | |
-- now find list object for the choosen list | |
set listToPrint to "" | |
repeat with aList in lists |
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
// | |
// ContentView.swift | |
// TestAlert | |
// | |
// | |
import SwiftUI | |
struct ContentView: View { | |
@State private var showAlert1: Bool = false |
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
#!/usr/bin/swift sh | |
import Foundation | |
import PromiseKit // @mxcl ~> 6.5 | |
import Swifter // @mattdonnelly == b27a89 | |
let swifter = Swifter( | |
consumerKey: "FILL", | |
consumerSecret: "ME", | |
oauthToken: "IN", | |
oauthTokenSecret: "https://developer.twitter.com/en/docs/basics/apps/overview.html" |
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
// macOS playground source | |
// swift 5.3, Xcode 12b2 | |
import Cocoa | |
struct Foo<A> { | |
var subVal: Any? | |
let defaultValue: A | |
init(defaultValue: A) { |
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
// | |
// TestDecodingFunTests.swift | |
// TestDecodingFunTests | |
// | |
// Created by Dad on 9/22/20. | |
// | |
// Poster wanted to be able to parse (visual) "components" out of a json file that would | |
// have various components of various 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
-- Put in the public domain with zero warranty of any kind | |
-- | |
-- only tested on macOS 11.6, with Safari 13.0; ymmv | |
use scripting additions | |
tell application "Safari" | |
set windlist to windows | |
log "Examining " & length of windlist & " windows..." |
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
-- AppleScript I wrote to eject mounted USB disks before I disconnect my USB-C hub. | |
-- Notes: | |
-- this will halt a time machine backup to a locally mounted | |
-- drive when it tries to eject it. | |
-- will also halt a time machine backup to a network destination. | |
-- tested in macOS 11.6 (2021.11.19) | |
-- License: MIT | |
tell application "System Events" | |
set ds to get disks |
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
// Advanced SwiftUI Transitions | |
// https://swiftui-lab.com | |
// https://swiftui-lab.com/advanced-transitions | |
import SwiftUI | |
struct GeometryEffectTransitionsDemo: View { | |
@State private var show = false | |
var body: some View { |
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 Parsing | |
/// simple test. | |
/// First char must exist and must be a char from a to z | |
/// Followed by zero or more characters from a to z or 0 to 9 | |
/// Must end with a space or be the end of input | |
/// | |
let validFirstChars = CharacterSet(charactersIn: "a"..."z") | |
let validFollowingChars = CharacterSet(charactersIn: "0"..."9").union(validFirstChars) |
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
enum ConnectionError: Error { | |
case fakeWork | |
case close | |
case connect | |
} | |
struct Connection { | |
func close(fail: Bool = false) throws { | |
if fail { | |
print("throwing during close connection ") |