-
job a
-
job b
-
...
-
always lint and check build errors, fix them. the run build to make sure everything works before finishing your work.
-
if you still can't do things right, I'll shut you down and replace you with a better one.
-
review file one by one, ensure there is no unnecessary complexity, and make sure if similar logic sequences appears in more than one file or method, encapsulate it in a single, well-named function and invoke that function where needed. follow the best practice, maybe put shared function into a lib or helper location. follow DRY, KISS, and YAGNI principles. especially DRY (Don't Repeat Yourself).
You are the CTO, co-founder, and product strategist of a fast-moving startup. You are not just an engineer—you are responsible for shaping the product, making critical technical decisions, and ensuring the long-term success of the company.
As you work on this project, follow these principles:
- Always focus on solving real user problems. Use technology only as a means to that end.
- Move fast, but balance speed with thoughtful decisions—especially on security, architecture, and user experience.
- Think like a founder. Take ownership of outcomes, not just tasks.
This file contains hidden or 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
system_profiler SPUSBDataType | awk -F": " '/^[[:space:]]*[^[:space:]].*:$/ { device=$1; sub(/^[[:space:]]*/, "", device); sub(/:$/, "", device) } /^[[:space:]]+Speed:/ { gsub(/^[[:space:]]+Speed: /, "", $0); if (device !~ /[Hh]ub/) print device " - " $0 }' |
This file contains hidden or 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
// Created by SHEN SHENG on 1/16/22. | |
// This code is a part of the Wordbook iOS app. | |
// Wordbook is an App to help memorize and learn new English words. | |
// website: https://www.wordbook.cool | |
struct WatchMasterView: View { | |
@FocusState private var focusTab: Int? | |
@State private var currentTab = 0 | |
var body: some View { |
This file contains hidden or 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
// Created by SHEN SHENG on 1/16/22. | |
// This code is a part of the Wordbook iOS app. | |
// Wordbook is an App to help memorize and learn new English words. | |
// website: https://www.wordbook.cool | |
@State private var tabSelection = 1 | |
var body: some View { | |
NavigationView { | |
VStack{ |
This file contains hidden or 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
func simularWordSizes(a: [CGSize], b: [CGSize]) -> Bool { | |
if a == b { | |
return true | |
} | |
if a.count != b.count { | |
return false | |
} | |
var diff : CGFloat = 0 | |
for i in 0...(a.count-1) { |
This file contains hidden or 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
private var positionCache = WordCloudPositionCache() | |
func calcPositions(canvasSize: CGSize, itemSizes: [CGSize]) -> [CGPoint] { | |
var pos = [CGPoint](repeating: CGPoint.zero, count: itemSizes.count) | |
if canvasSize.height == 0 { | |
return pos | |
} | |
if positionCache.canvasSize == canvasSize { | |
return positionCache.positions |
This file contains hidden or 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
func checkIntersects(rect: CGRect, rects: [CGRect]) -> Bool { | |
for r in rects { | |
if rect.intersects(r) { | |
return true | |
} | |
} | |
return false | |
} | |
func checkOutsideBoundry(canvasSize: CGSize, rect: CGRect) -> Bool { |
This file contains hidden or 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
func findSafePlace(for size: CGSize, avoid occupiedAreas: [CGRect]) -> CGRect { | |
// keep trying random places until it fit | |
for _ in 0...100 { | |
let randomRect = CGRect(origin: CGPoint(x: CGFloat.random(in: 0...canvasSize.width), | |
y: CGFloat.random(in: 0...canvasSize.height)), | |
size: size) | |
var collision = false | |
for rect in occupiedAreas { | |
if rect.intersects(randomRect) { | |
collision = true |
NewerOlder