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
extension UIApplication { | |
var currentKeyWindow: UIWindow? { | |
UIApplication.shared.connectedScenes | |
.filter { $0.activationState == .foregroundActive } | |
.map { $0 as? UIWindowScene } | |
.compactMap { $0 } | |
.first?.windows | |
.filter { $0.isKeyWindow } | |
.first | |
} |
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
// https://www.jessesquires.com/blog/2018/11/17/executing-applescript-in-mac-app-on-macos-mojave/ | |
private func runScript() { | |
// Solution 1 | |
let script = """ | |
tell application "Notes" | |
tell account "iCloud" | |
make new note at folder "Notes" with properties {name:"14:53 Daily Notes", body:""} | |
set noteRunTime to get notes whose name is "14:53 Daily Notes" | |
show item 1 of noteRunTime |
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
// | |
// ContentView.swift | |
// socket-demo | |
// | |
// Created by Erdem ILDIZ | |
// | |
import SwiftUI | |
import SocketIO |
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
// | |
// CurrencyListModel.swift | |
// socket-demo | |
// | |
// Created by Erdem ILDIZ | |
// | |
import Foundation | |
// MARK: - CurrencyList |
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 express from "express"; | |
import { createServer } from "http"; | |
import { Server } from "socket.io"; | |
import fetch from "node-fetch"; | |
const app = express(); | |
const server = createServer(app); | |
const io = new Server(server, { | |
allowEIO3: true, | |
}); |
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
npm install |
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
{ | |
"name": "socketdemo", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", |
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
mkdir socketdemo && cd socketdemo && touch index.js && npm init |
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
pod install |
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
# Uncomment the next line to define a global platform for your project | |
# platform :ios, '9.0' | |
target 'socket-demo' do | |
# Comment the next line if you don't want to use dynamic frameworks | |
use_frameworks! | |
pod 'Socket.IO-Client-Swift', '~> 15.2.0' | |
# Pods for socket-demo | |
end |