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
// Based on: https://gist.github.com/terranware/962da63ca547f55667f6 | |
var https = require('https'); | |
var util = require('util'); | |
exports.handler = function(event, context) { | |
console.log(JSON.stringify(event, null, 2)); | |
console.log('From SNS:', event.Records[0].Sns.Message); | |
var postData = { |
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
struct WebImageMetaData: Decodable { | |
let title: String? | |
let summary: String? | |
let url: URL? | |
let image: URL? | |
let mimetype: String? | |
let width: String? | |
let height: String? | |
private enum CodingKeys: String, CodingKey { |
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
// For images... | |
import AppKit | |
extension URL { | |
func getImageSize() -> CGSize? { | |
guard let src = CGImageSourceCreateWithURL(self as CFURL, nil) else { | |
return nil | |
} |
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
// | |
// ExampleView.swift | |
// | |
// Created by Gboyega Dada on 13/01/2024. | |
// | |
import SwiftUI | |
struct ExampleView: View { | |
var src: URL |
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
// | |
// TransferableItem.swift | |
// | |
// Created by Gboyega Dada on 22/11/2023. | |
// | |
// @see https://stackoverflow.com/a/57648296/1661299 | |
// @see https://exploringswift.com/blog/creating-a-nsitemprovider-for-custom-model-class-drag-drop-api | |
// @see https://stackoverflow.com/a/66169874/1661299 | |
// |
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
# Examples of Different Styles and Syntax | |
# legal / positive case / you can do these stuffs | |
# --------------------------------------------------------------------------- | |
# single line, nothing special | |
Enum.map(0...2, fn i -> IO.puts i end) | |
""" | |
0 | |
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
// | |
// AlertCenter.swift | |
// | |
// Created by Gboyega Dada on 03/05/2024. | |
// | |
import Foundation | |
import SwiftUI | |
@Observable class AlertCenter { |
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
// issue: you are writing a bunch of CGImages to disk concurrently and getting this in the logs: | |
AVEBridge Info: AVEEncoder_CreateInstance: Received CreateInstance (from VT) | |
AVEBridge Error: startUserClient: IOServiceOpen returned 0xe00002e2 | |
Assert - (err == noErr) - f: /AppleInternal/Library/BuildRoots/989643e2-e205-11ee-ae2f-ae2a9a6175d7/Library/Caches/com.apple.xbs/Sources/AppleAVEBridge/AppleAVEEncoder/AppleAVEEncoder.c l: 1955 | |
AVE FIG ERROR: createChannel failed. | |
AVEBridge Error: AVEEncoder_CreateInstance: returning err = -536870174 | |
IMKInputSession (deactivate) timed out waiting for response | |
IMKInputSession (deactivate) timed out waiting for response |