This file contains hidden or 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
/// > Note: You'll see I've referenced `isPreview` below. | |
/// > To run code for Previews only, place this somewhere, | |
/// > either as a global method, or anywhere close at hand. | |
/// | |
/// ```swift | |
/// public var isPreview: Bool { | |
/// return ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] == "1" | |
/// } | |
/// ``` |
This file contains hidden or 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
// MARK: - Canvas | |
struct GridCanvas: Equatable, Sendable { | |
var font: GridFont | |
var dimensions: Dimensions | |
/// Note: This array is a 'long straight line' of every Cell in the artwork. | |
/// Previously I was using a 2D array, as this better matched my mental | |
/// model for a typical Grid layout, but performance impact of iterating | |
/// over nested arrays became a concern. |
This file contains hidden or 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 AppKit | |
import Neon | |
import TreeSitterMarkdown | |
import TreeSitterMarkdownInline | |
import SwiftTreeSitter | |
import TreeSitterClient | |
extension MarkdownViewController { | |
static func makeHighlighter(for textView: MarkdownTextView) throws -> TextViewHighlighter { |
This file contains hidden or 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
/* | |
See LICENSE folder for this sample’s licensing information. | |
Abstract: | |
The extension of CircleTextViewController that handles glyph substitution. | |
*/ | |
import UIKit | |
extension CircleTextViewController { |
This file contains hidden or 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 math | |
canvas = 2000 | |
frameRate = 24 | |
duration = 1400 # in milliseconds | |
txt = "snape" | |
tulipPath = "/Library/Application Support/Adobe/Fonts/Tulip3GX.ttf" | |
fontName = installFont(tulipPath) |
This file contains hidden or 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
var headings = document.getElementsByTagName('h1'); | |
headings.onclick = function() { | |
console.log('You clicked on a heading!'); | |
} |
This file contains hidden or 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
#MenuTitle: Task Launcher | |
# -*- coding: utf-8 -*- | |
#!/usr/bin/env python | |
# Created by Dave | |
__doc__=""" | |
Task launcher | |
""" | |
### Modules | |
from vanilla import FloatingWindow, SquareButton |
This file contains hidden or 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
#MenuTitle: Toggle variant labels | |
# -*- coding: utf-8 -*- | |
# Created by Dave | |
__doc__=""" | |
Toggle variant labels | |
""" | |
import vanilla | |
import GlyphsApp |
This file contains hidden or 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
def glyphListv1(): | |
thisFont = Glyphs.font # frontmost font | |
thisGlyph = Glyphs.font.glyphs | |
v1 = "v1" | |
v1List = [] | |
try: | |
def ToggleVariantLabelsOFF( self, sender ): | |
try: |