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
let sketch = require('sketch') | |
var fiber = require('sketch/async').createFiber() | |
var url = NSURL.URLWithString("https://github.com/KevinGutowski/Testing/raw/main/Test.sketch") | |
let session = NSURLSession.sharedSession() | |
let block = __mocha__.createBlock_function('v32@?0@"NSURL"8@"NSURLResponse"16@"NSError"24', (url,response,error) => { | |
try { | |
let docError = MOPointer.alloc().init() | |
var newDocument = MSDocument.alloc().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
const sketch = require("sketch"); | |
function onDocumentChanged(context) { | |
var changes = context.actionContext; | |
for (i = 0; i < changes.length; i++) { | |
var change = changes[i]; | |
var path = change.fullPath(); | |
var type = change.type(); | |
switch (type) { |
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
let sketch = require('sketch') | |
let Document = sketch.Document | |
let path = "/Users/kgutowski/Downloads/Test.sketch" | |
let url = NSURL.fileURLWithPath(path) | |
let externalDoc = MSDocument.alloc().init() | |
externalDoc.readDocumentFromURL_ofType_error(url, "com.bohemiancoding.sketch.drawing", nil); // Be sure to capture error properly | |
let jsDoc = Document.fromNative(externalDoc) | |
console.log(jsDoc) |
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
// | |
// LinkLabel.swift | |
// TestText | |
// | |
// Created by Kevin Gutowski on 1/12/21. | |
// | |
import Cocoa | |
@IBDesignable |
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 | |
// MARK: - Gist | |
struct Gist: Codable { | |
let url, forksURL, commitsURL: String | |
let id, nodeID: String | |
let gitPullURL, gitPushURL: String | |
let htmlURL: String | |
var files: [File] | |
let gistPublic: Bool |
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://swiftsenpai.com/swift/decode-dynamic-keys-json/ | |
// https://stackoverflow.com/questions/49549691/how-to-handle-dynamic-keys-from-json-response-using-swift-4-coding-keys | |
import Foundation | |
let json = """ | |
{ | |
"name": "Avengers High", | |
"students": { | |
"S001": { |
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 | |
struct Gist:Codable { | |
let url: String | |
let files: [File] | |
} | |
struct File:Codable { | |
let filename,type,language,rawURL: String | |
let size: Int |
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
console.log("hello world") |
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
let documentWindow = NSApplication.sharedApplication().mainWindow() | |
let mySheetWindow = NSWindow.alloc().initWithContentRect_styleMask_backing_defer( | |
NSMakeRect(0, 0, 300, 50), | |
(NSWindowStyleMaskTitled | NSWindowStyleMaskDocModalWindow), | |
NSBackingStoreBuffered, | |
true | |
) | |
let progressView = NSProgressIndicator | |
.alloc() |