Skip to content

Instantly share code, notes, and snippets.

View jaywcjlove's full-sized avatar

小弟调调 jaywcjlove

View GitHub Profile
@jaywcjlove
jaywcjlove / NSSharingService-sharingServices-deprecation-warning-fix.swift
Created September 7, 2024 18:46 — forked from sindresorhus/NSSharingService-sharingServices-deprecation-warning-fix.swift
macOS 13 deprecated `NSSharingService.sharingServices()`. Here's how to silence the deprecation until you can move to the new API.
private protocol SilenceDeprecationNSSharingService {
func sharingServices(forItems items: [Any]) -> [NSSharingService]
}
private final class SilenceDeprecationNSSharingServiceImplementation: SilenceDeprecationNSSharingService {
@available(macOS, deprecated: 13)
func sharingServices(forItems items: [Any]) -> [NSSharingService] {
NSSharingService.sharingServices(forItems: items)
}
}
@jaywcjlove
jaywcjlove / WeatherView.swift
Created November 10, 2023 05:26 — forked from unixzii/WeatherView.swift
A demo of implementing iOS Weather card in SwiftUI.
import SwiftUI
struct HeaderView: View {
var body: some View {
HStack {
Image(systemName: "info.circle.fill")
.resizable()
.frame(width: 12, height: 12)
Text("Section Header")
.font(.system(size: 13))
package main
import (
"crypto/tls"
"flag"
"io"
"log"
"net"
"net/http"
"net/http/httputil"