This file contains hidden or 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 path = NSHomeDirectory() + '/Library/Logs/DiagnosticReports/' | |
| let fileManager = NSFileManager.defaultManager() | |
| let files = fileManager.contentsOfDirectoryAtPath_error(path,nil) | |
| let fileNames = [] | |
| for (let i=0; i<files.count();i++) { | |
| fileNames.push(files[i]) | |
| } | |
| let dateFormatter = NSDateFormatter.alloc().init() | |
| dateFormatter.dateStyle = NSDateFormatterMediumStyle |
This file contains hidden or 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
| <!-- | |
| Integration as summation | |
| GS LaTeX Code | |
| $$$ | |
| \int_a^bf(x)dx = lim_{n\to\infty}\sum_{r=1}^nhf(a+rh) | |
| $$$ | |
| $$$ | |
| \text{where} \quad h=\frac{b-a}{n} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |