Skip to content

Instantly share code, notes, and snippets.

View morphinewan's full-sized avatar
🎮
Xbox Forever

Wan Yi morphinewan

🎮
Xbox Forever
View GitHub Profile
@morphinewan
morphinewan / calendar-subscription.swift
Created October 31, 2024 06:21
添加一个订阅日历
import EventKit
class CalendarSubscriptionManager {
private let eventStore = EKEventStore()
// 添加日历订阅
func addCalendarSubscription(url: String, title: String, completion: @escaping (Bool, Error?) -> Void) {
// 首先请求日历访问权限
requestCalendarAccess { [weak self] granted, error in
guard granted else {
@morphinewan
morphinewan / untitled.sh
Created October 10, 2024 07:21
如何删除SwiftUI预览缓存
xcrun simctl --set previews delete all

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
@morphinewan
morphinewan / nf_check.js
Last active August 28, 2024 01:16 — forked from Hyseen/nf_check.js
Netflix可用性检查脚本,适用于Surge
const BASE_URL = 'https://www.netflix.com/title/'
const FILM_ID = 81215567
const AREA_TEST_FILM_ID = 80018499
;(async () => {
let result = {
title: 'Netflix 解锁检测',
style: 'error',
content: '检测失败,请刷新',
@morphinewan
morphinewan / index.js
Created September 25, 2020 08:09 — forked from shospodarets/Chrome headless Puppeteer- capture DOM element screenshot using
使用puppeteer截取特定DOM元素的图片
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
// Adjustments particular to this page to ensure we hit desktop breakpoint.
page.setViewport({width: 1000, height: 600, deviceScaleFactor: 1});
await page.goto('https://www.chromestatus.com/samples', {waitUntil: 'networkidle'});
@morphinewan
morphinewan / Neumorphism.swift
Last active August 1, 2024 01:42
如何设计新拟态按钮
// 概念教程可参看
// https://sarunw.com/posts/how-to-create-neomorphism-design-in-swiftui/
// 如何设计一套炫酷按钮
// https://www.hackingwithswift.com/articles/213/how-to-build-neumorphic-designs-with-swiftui?utm_campaign=iOS%2BDev%2BWeekly&utm_medium=email&utm_source=iOS%2BDev%2BWeekly%2BIssue%2B445
import SwiftUI
extension Color {
static let offWhite = Color(red: 225 / 255, green: 225 / 255, blue: 235 / 255)