- copy
VSCode.idekeybindings
to~/Library/Developer/Xcode/UserData/KeyBindings
- in Xcode preferences -> key bindings, select VSCode
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
#!/usr/bin/osascript | |
tell application "Finder" | |
set selectedItems to selection | |
set itemList to "" | |
repeat with anItem in selectedItems | |
set itemList to itemList & POSIX path of (anItem as alias) & "\n" | |
end repeat | |
return itemList | |
end tell |
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
<!-- TradingView Widget BEGIN --> | |
<div class="tradingview-widget-container"> | |
<div id="tradingview_01ba8"></div> | |
<div class="tradingview-widget-copyright"><a href="https://www.tradingview.com/symbols/BINANCE-ATOMUSDT/" rel="noopener" target="_blank"><span class="blue-text">ATOMUSDT Chart</span></a> by TradingView</div> | |
<script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script> | |
<script type="text/javascript"> | |
new TradingView.widget( | |
{ | |
"autosize": true, | |
"symbol": "BINANCE:ATOMUSDT", |
Harnessing The Power of Both Languages in Your Apps
WebKit allows us to use javascript along side with the native swift code. On one hand, we could call the javascript statements in swift. On the other hand, javascript from web view could be able to trigger a delegate method defined in swift code. This gives us a two way communication between the native swift code and javascript used by a web view.
Here we have a window with a WKWebView showing some text. It has 2 buttons inside. One for showing the text and triggering a swift handler, the other for hiding the text. Also, we have a native button that triggers a javascript function to hide the text.
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
func applicationDidFinishLaunching(_ aNotification: Notification) { | |
let runningApps = NSWorkspace.shared.runningApplications | |
let isRunning = runningApps.contains { | |
$0.bundleIdentifier == "your.domain.TestAutoLaunch" | |
} | |
if !isRunning { | |
var path = Bundle.main.bundlePath as NSString | |
for _ in 1...4 { | |
path = path.deletingLastPathComponent as NSString |