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
#!/bin/bash | |
# | |
# Create a new monorepo by fusing multiple repositories. | |
# | |
# Exit immediately if a command exits with a non-zero status, | |
# and print commands and their arguments as they are executed. | |
set -ex | |
# Set the name of the org, and the monorepo to create | |
GITHUB_ORG="github-org-or-account" |
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 {EditorState, EditorView, basicSetup} from "@codemirror/basic-setup" | |
import { StateField } from "@codemirror/state"; | |
import { Line } from "@codemirror/text"; | |
import { Decoration, DecorationSet, WidgetType } from "@codemirror/view"; | |
let doc = ` | |
Test list 1 | |
- Test item | |
- Test item |
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 {EditorState, EditorView, basicSetup} from "@codemirror/basic-setup" | |
import { foldEffect } from "@codemirror/fold"; | |
import { Line } from "@codemirror/text"; | |
import { Decoration, DecorationSet, PluginValue, ViewPlugin, ViewUpdate, WidgetType } from "@codemirror/view"; | |
let doc = ` | |
Test list 1 | |
- Test item | |
- Test item |
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
// | |
// WrappableViewController.swift | |
// macOS-Wordflower | |
// | |
// Created by Marcus Westin on 1/24/20. | |
// Copyright © 2020 Marcus Westin. All rights reserved. | |
// | |
// My preferred approach to wrapping AppKit and UIKit viewControllers in SwiftUI |
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
// | |
// WrappableView.swift | |
// macOS-Wordflower | |
// | |
// Created by Marcus Westin on 1/24/20. | |
// Copyright © 2020 Marcus Westin. All rights reserved. | |
// | |
// My preferred approach to wrapping AppKit and UIKit views in SwiftUI |
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
protocol ViewWrapper { | |
associatedtype ViewType: OSView | |
typealias Context = OSViewRepresentableContext<WrapView<Self>> | |
func makeView(_ context: Context) -> ViewType | |
func updateView(_ view: ViewType, _ context: Context) | |
func wrapped() -> WrapView<Self> | |
} | |
struct WrapView<Wrapper: ViewWrapper>: OSViewRepresentable { | |
let wrapper: () -> Wrapper |
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 | |
#if os(macOS) | |
typealias OSView = NSView | |
typealias OSViewRepresentable = NSViewRepresentable | |
#elseif os(iOS) | |
typealias OSView = UIView | |
typealias OSViewRepresentable = UIViewRepresentable | |
#endif |
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 Foundation | |
class LinkedList<T> { | |
private class Link<T> { | |
var prev: Link? | |
var next: Link? | |
let value: T | |
init(_ value: T) { | |
self.value = 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 Foundation | |
final class Atomic {} | |
extension Atomic { | |
// Atomic value example: | |
// let val = Atomic.Value<Int>(1) | |
// val.mutate { $0 += 1 } | |
// val.get() | |
final class Value<T> { |
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 Combine | |
private var retainForever = [AnyCancellable]() | |
class ObservableProperty<T>: ObservableObject { | |
@Published private var value: T | |
init(initialValue: T) { | |
self.value = initialValue | |
} |
NewerOlder