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
#!/bin/bash | |
# Define an array of known SSIDs | |
KNOWN_SSIDS=("☕️" "Network2" "Network3") # Replace with your network names | |
# Get the current Wi-Fi SSID | |
CURRENT_SSID=$(system_profiler SPAirPortDataType | grep -A2 'Status: Connected' | tail -n1 | sed 's/:$//' | xargs) | |
echo $CURRENT_SSID |
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
#!/bin/bash | |
# Function to check if an app is playing | |
check_playing() { | |
if pgrep -x "$1" > /dev/null; then | |
if osascript -e "tell application \"$1\" to player state" | grep -q "playing"; then | |
return 0 # 0 means true in Bash | |
fi | |
fi | |
return 1 # 1 means false in Bash |
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 os | |
import json | |
import shutil | |
def process_xcassets_folder(xcassets_path): | |
for item in os.listdir(xcassets_path): | |
item_path = os.path.join(xcassets_path, item) | |
if os.path.isdir(item_path): | |
process_child_folder(item_path) |
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 SwiftUI | |
struct WhatNotView< | |
OffCircleContent: View, | |
OnCircleContent: View, | |
OffTrailingContent: View, | |
OnTrailingContent: View | |
>: View { | |
@State var toggle: Bool = false | |
@ScaledMetric var scale: CGFloat = 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
import Foundation | |
import AppIntents | |
public struct CoffeePropertyQuery: EntityPropertyQuery { | |
public init() { } | |
public func entities(for identifiers: [Coffee.ID]) async throws -> [Coffee] { | |
Coffee.all.filter({ identifiers.contains($0.id) }) | |
} |
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 SwiftUI | |
import Combine | |
import ComposableArchitecture | |
struct AppState: Equatable { | |
var count = 0 | |
} | |
enum AppAction: Equatable { | |
case decrementButtonTapped | |
case incrementButtonTapped |
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
// | |
// ContentView.swift | |
// Searchable | |
// | |
// Created by Alex Logan on 27/06/2021. | |
// | |
import SwiftUI | |
struct Coffee: Hashable { |
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
struct Coffee: Hashable { | |
let name: String | |
} | |
class CoffeeStore: ObservableObject { | |
func getCoffee() async -> [Coffee] { | |
Thread.sleep(forTimeInterval: 2) | |
return [ | |
Coffee(name: "Cortado"), | |
Coffee(name: "Flat White") |
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
// | |
// WelcomeView.swift | |
// iOS | |
// | |
// Created by Alex Logan on 30/08/2020. | |
// | |
import SwiftUI | |
struct WelcomeView: View { |
NewerOlder