WWDC 2006 2007 2008 2009 2010 2011 2012 2013 2014
tell application "System Events" | |
set frontmostApplication to name of first application process whose frontmost is true | |
set browserName to "" | |
if frontmostApplication is "Arc" then | |
tell application "Arc" to return URL of active tab of window 1 | |
else if frontmostApplication is "Google Chrome" then | |
tell application "Google Chrome" to return URL of active tab of window 1 | |
else if frontmostApplication is "Brave Browser" then | |
tell application "Brave Browser" to return URL of active tab of window 1 |
const API_URL = "https://api.openai.com/v1/chat/completions"; | |
const MAX_TOKENS = 1500; | |
const TEMPERATURE = 0.5; | |
const SYSTEM_PROMPT = 'Act as assistant'; | |
const MESSAGES = ["hello", "hi!", "how are you?"]; | |
async function openAICompletion(msg) { | |
const options = { | |
method: "POST", | |
headers: { |
struct User: Equatable { | |
var firstName: String | |
var lastName: String | |
} | |
@main | |
struct MyApp: App { | |
@State var value = User(firstName: "", lastName: "") | |
@State var showEdit = false |
I've been working through the exercises in the excellent iOS Unit Testing by Example book by Jon Reid, which I highly recommend. However, the book is in beta at the moment and there are some curveballs thrown by iOS 13 that aren't handled in the text yet. Specifically, when I hit the section about using a testing AppDelegate
class I thought "This is very good. But what about the SceneDelegate
?"
In Chapter 4 the recommendation is to remove the @UIApplicationMain
decoration and make a manual top-level call to UIApplicationMain
. To wit:
import UIKit
simulatorsIdentifiers=$(instruments -s devices | | |
grep -o "iPhone .* (.*) \[.*\]" | #only iPhone | |
grep -o "\[.*\]" | #only UUID | |
sed "s/^\[\(.*\)\]$/\1/" | #remove square brackets | |
sed 's/^/"/;$!s/$/"/;$s/$/"/' | #add quotes | |
sed '$!s/$/,/' #add comma to separate each element | |
) | |
arrayOfSimulatorsIdentifiers=($(echo "$simulatorsIdentifiers" | tr ',' '\n')) |
There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore
is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules
directory) as well as files that are generated (and regenerated) as artifacts of a build process.
All other files should be in your own global gitignore file:
- Create a file called
.gitignore
in your home directory and add any filepath patterns you want to ignore. - Tell git where your global gitignore file is.
Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute
.config/git/ignore
for.gitignore
in your home directory, if you prefer.