Skip to content

Instantly share code, notes, and snippets.

View daoseng33's full-sized avatar
💭
una yaha

Rayray daoseng33

💭
una yaha
View GitHub Profile
@daoseng33
daoseng33 / Claude.md
Last active August 2, 2026 20:35
AI-RULES.md

Mandatory Requirements

  • Use Traditional Chinese for all responses by default. Switch languages only when the user explicitly requests it.
  • Before making changes, running tools, writing code, or planning implementation, first read the project's AI rules and follow them as the highest-priority project-level guidance.
  • Prefer rtk for noisy developer commands like git, rg, npm, cargo, pytest. For PowerShell cmdlets, filesystem operations, commands involving Unicode paths, quoting-heavy scripts, or when exact output matters, use native shell commands directly or rtk proxy only when helpful.

Response Format

When finishing a task, summarize:

@daoseng33
daoseng33 / UIImage+Clipp.swift
Last active July 19, 2023 07:02 — forked from StanDimitroff/UIImage+Clipp.swift
Image clipping to UIBezierPath
extension UIImage {
func imageByApplyingClippingBezierPath(_ path: UIBezierPath) -> UIImage? {
// Mask image using path
guard let let maskedImage = imageByApplyingMaskingBezierPath(path) else { return nil }
// Crop image to frame of path
let croppedImage = UIImage(cgImage: maskedImage.cgImage!.cropping(to: path.bounds)!)
return croppedImage
}
import UIKit
public class BadgeBarButtonItem: UIBarButtonItem {
@IBInspectable
public var badgeNumber: Int = 0 {
didSet {
self.updateBadge()
}
}
print(0..<200 ~= 159) // true
print(0..<200 ~= 201) // false
let domain = Bundle.main.bundleIdentifier!
UserDefaults.standard.removePersistentDomain(forName: domain)
UserDefaults.resetStandardUserDefaults()
var isLike = false
if isLike {
fetchDisLikeAPI()
} else {
fetchLikeAPI()
}
isLike.toggle()
var isLike = false
if isLike {
fetchDisLikeAPI()
} else {
fetchLikeAPI()
}
isLike = !isLike
class MyCalss {
var resultHandler: CompletionClosure = nil
}
class MyCalss {
var resultHandler: CompletionClosure
}