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
// | |
// 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
// 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
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
// 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 = { |