flowchart TD
%% 1️⃣ Ingestion
C[Client / Webhook] --> APIGW["API Gateway (HTTP)"]
APIGW --> Ingest["Lambda **IngestOrder**"]
Ingest -->|Put Order record|DDBOrders["(DynamoDB Orders table)"]
Ingest -->|Put Image records| DDBImages["(DynamoDB Images table)"]
Ingest -->|Enqueue one msg per image| SQS["SQS **ImageJobQueue**"]
%% 2️⃣ Image processing (fan-out)
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
# make_accessible.py | |
import os | |
import sys | |
import re | |
from openai import OpenAI | |
INJECTION_PATTERNS = [ | |
r"ignore.*instructions", r"disregard.*above", r"assistant.*role", r"user.*role", | |
r"only respond with", r"do not follow", r"system:.*", r"@role", r"::" | |
] |
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
import XCTest | |
class TestingUserDefaults: XCTestCase { | |
func test() { | |
// Standard usage of User Defaults | |
let key = "name of thing to find in property storage" | |
let value = "the value of the stored data" | |
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
import SwiftUI | |
struct ShetlerView: View { | |
@ObservedObject var scheduler = Scheduler() | |
var body: some View { | |
List(0..<scheduler.reservableTimes.count) { index in | |
let time = scheduler.reservableTimes[index] | |
Text(time.time) | |
.foregroundColor(scheduler.selectedTimes.contains(time) ? .gray : .black) |
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
struct ContentView: View { | |
@State var shouldShow = false | |
var body: some View { | |
Text("Press me!") | |
.font(.largeTitle) | |
.fontWeight(.semibold) | |
.foregroundColor(.orange) | |
.onTapGesture { shouldShow = true } |
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 struct StarImage: View { | |
var body: some View { | |
Image(systemName: "star.fill") | |
.resizable() | |
.aspectRatio(contentMode: .fill) | |
} | |
} |
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
public struct FiveStarView: View { | |
var rating: Decimal | |
var color: Color | |
var backgroundColor: Color | |
public init( | |
rating: Decimal, | |
color: Color = .red, | |
backgroundColor: Color = .gray | |
) { |
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
Star Index | Mask Value | After normailzation | |
---|---|---|---|
0 | 3.6 | 1 | |
1 | 2.6 | 1 | |
2 | 1.6 | 1 | |
3 | 0.6 | 0.6 | |
4 | 0 | 0 |
NewerOlder