Skip to content

Instantly share code, notes, and snippets.

View nickmain's full-sized avatar

Nick Main nickmain

View GitHub Profile
@nickmain
nickmain / tryToSendFocus.swift
Created January 11, 2022 00:29
Forced focus targetting
// Focus management
private var targetFocusEnv: UIFocusEnvironment?
override var preferredFocusEnvironments: [UIFocusEnvironment] {
if let target = targetFocusEnv {
return [target]
} else {
return []
}
}
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: Python [16800]
Path: /Library/Frameworks/Python.framework/Versions/3.10/Resources/Python.app/Contents/MacOS/Python
Identifier: org.python.python
Version: 3.10.2 (3.10.2)
Code Type: X86-64 (Native)
Parent Process: zsh [3556]
@nickmain
nickmain / Subscriptions-iCloud.opml
Created November 10, 2023 00:41
NetNewsWire Subscriptions
<?xml version="1.0" encoding="UTF-8"?>
<!-- OPML generated by NetNewsWire -->
<opml version="1.1">
<head>
<title>Subscriptions-iCloud.opml</title>
</head>
<body>
<outline text="Reddit" title="Reddit">
<outline text="Forth - The programming language for low-fat computing." title="Forth - The programming language for low-fat computing." description="" type="rss" version="RSS" htmlUrl="https://www.reddit.com/r/Forth/" xmlUrl="http://www.reddit.com/r/Forth/.rss"/>
<outline text="Programming in Logic :- Prolog" title="Programming in Logic :- Prolog" description="" type="rss" version="RSS" htmlUrl="https://www.reddit.com/r/prolog/" xmlUrl="http://www.reddit.com/r/prolog/.rss"/>
@nickmain
nickmain / zshrc
Created April 16, 2024 16:46
Current zshrc
export PATH="$HOME/Developer/tools/bin:$PATH"
PS1='%1d 🔸 '
RPROMPT="%F{blue}%B%*%b%f"
alias la='ls -la'
alias now='date +"%s"'
alias ded="rm -rf ~/Library/Developer/Xcode/DerivedData;rm -rf ~/Library/Caches/org.swift.swiftpm"
alias ..='cd ..'
alias branch='git branch'
@nickmain
nickmain / OCaml.plist
Created January 23, 2025 20:41 — forked from GPHemsley/OCaml.plist
OCaml Codeless Language Module for TextWrangler and BBEdit syntax highlighting
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BBEditDocumentType</key>
<string>CodelessLanguageModule</string>
<key>BBLMLanguageCode</key>
<string>OCml</string>
import Foundation
func appendTo<each T, E>(tuple: (repeat each T), element: E) -> (repeat each T, String, E) {
(repeat each tuple, "DIVIDER", element)
}
let firstTuple = appendTo(tuple: 1, element: "two")
let appendedTuple = appendTo(tuple: firstTuple, element: 3.3)
print(appendedTuple) // (1, "DIVIDER", "two", "DIVIDER", 3.3)
print(type(of: appendedTuple)) // (Int, String, String, String, Double)