Skip to content

Instantly share code, notes, and snippets.

View erdemildiz's full-sized avatar
🏠
Working from home

Erdem ILDIZ erdemildiz

🏠
Working from home
View GitHub Profile
@erdemildiz
erdemildiz / swiftui-top-view-has-modal.swift
Created May 18, 2022 14:38
SwiftUI check has modal on modal
extension UIApplication {
var currentKeyWindow: UIWindow? {
UIApplication.shared.connectedScenes
.filter { $0.activationState == .foregroundActive }
.map { $0 as? UIWindowScene }
.compactMap { $0 }
.first?.windows
.filter { $0.isKeyWindow }
.first
}
// 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
//
// ContentView.swift
// socket-demo
//
// Created by Erdem ILDIZ
//
import SwiftUI
import SocketIO
//
// CurrencyListModel.swift
// socket-demo
//
// Created by Erdem ILDIZ
//
import Foundation
// MARK: - CurrencyList
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,
});
{
"name": "socketdemo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
@erdemildiz
erdemildiz / socket-npm-init.sh
Last active December 24, 2021 08:48
Socket npm init
mkdir socketdemo && cd socketdemo && touch index.js && npm init
@erdemildiz
erdemildiz / pod-run.sh
Last active December 23, 2021 19:56
Pod run
pod install
@erdemildiz
erdemildiz / socket-pod-file.rb
Created December 23, 2021 19:44
Socket pod file
# 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