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 Foundation | |
// Some clearly non-NSObject-based models: | |
enum Coconut: String { | |
case small, medium, large | |
} | |
struct Tomato { | |
static var red = Tomato(color: #colorLiteral(red: 0.7490196078, green: 0.09803921569, blue: 0.02352941176, alpha: 1)) |
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
function loadJQuery(){ | |
script = document.createElement('script'); | |
script.setAttribute('src', '//code.jquery.com/jquery-2.1.3.js'); | |
script.setAttribute('type', 'text/javascript'); | |
script.onload = loadSaveAs; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
} | |
function loadSaveAs(){ | |
saveAsScript = document.createElement('script'); |
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
tell application "Safari" | |
activate | |
set theURL to the URL of the current tab of the front window | |
close current tab of front window | |
end tell | |
tell application "Safari" | |
activate | |
set theWindow to false | |
repeat with w in (every window whose visible is 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
tell application "Safari" | |
activate | |
set theURL to the URL of the current tab of the front window | |
close current tab of window 1 | |
end tell | |
tell application "System Events" | |
tell process "Safari" | |
tell menu bar 1 | |
click menu bar item "File" |