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
// 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
#!/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
// | |
// 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
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
import SwiftUI | |
struct ContentView: View { | |
@State private var showSheet: Bool = false | |
@State private var name: String = "Default Name" | |
var body: some View { | |
VStack { | |
Text("Hello, World!") | |
.frame(maxWidth: .infinity, maxHeight: .infinity) |
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 | |
// bugtest | |
// | |
// Copyright © 2020 Geek & Dad, LLC All rights reserved. | |
// | |
import SwiftUI | |
struct PreferenceTest: 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
// | |
// ContentView.swift | |
// PreviewsTips2020.01.24 | |
// Updated 2021.09.24 | |
// | |
// Dad | |
// @GeekAndDad | |
// | |
// Code from blog post: | |
// https://geekanddad.wordpress.com/2020/01/24/tiny-hints-a-couple-of-xcode-11-3-swiftui-preview-tips/ |
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
// from the blog post: https://geekanddad.wordpress.com/2020/01/23/snippet-swiftui-view-printmessage-extension/ | |
import SwiftUI | |
import PlaygroundSupport | |
struct ContentView: View { | |
var body: some View { | |
VStack { | |
TestView(label: "hello", idx: 22) | |
.font(.title) |
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
// paste into new macOS playground | |
// Xcode 11.3 on 10.15.2 | |
import Cocoa | |
protocol InfoTypeProtocol {} | |
protocol Base { | |
associatedtype InfoType: InfoTypeProtocol | |
var info: InfoType { get set } |