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 Foundation | |
import SwiftData | |
@Model | |
final class ApproachModel { | |
var title: String | |
var shownInYear: Bool = true | |
var shownInMonth: Bool = true | |
var shownInWeek: Bool = true | |
var shownInDay: Bool = 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
import SwiftData | |
import Foundation | |
enum DateGranularity: Codable { | |
case year | |
case month | |
case week | |
case day | |
} |
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 | |
import SwiftData | |
struct ApproachContentView: View { | |
@State private var viewModel: ApproachViewModel | |
var body: some View { | |
NavigationStack { | |
List(viewModel.todoLists) { todoList in | |
Section(header: Text(todoList.title)) { |
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 | |
import SwiftData | |
@main | |
struct SwiftDataTestApp: App { | |
let container: ModelContainer | |
var body: some Scene { | |
WindowGroup { | |
ApproachContentView(modelContext: container.mainContext) |
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
from flask import Flask, request, jsonify, make_response | |
from werkzeug.utils import secure_filename | |
import dlib | |
import cv2 | |
import face_recognition | |
import os | |
import postgresql | |
app = Flask(__name__) |
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
from flask import Flask, request, jsonify, make_response | |
from werkzeug.utils import secure_filename | |
import dlib | |
import cv2 | |
import face_recognition | |
import os | |
import postgresql | |
app = Flask(__name__) |
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 postgresql | |
db = postgresql.open('pq://user:pass@localhost:5434/db') | |
db.execute("create extension if not exists cube;") | |
db.execute("drop table if exists vectors") | |
db.execute("create table vectors (id serial, file varchar, image_id numeric, vec_low cube, vec_high cube);") | |
db.execute("create index vectors_vec_idx on vectors (vec_low, vec_high);") |
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
PENPOT_PUBLIC_URI=http://localhost:9001 | |
PENPOT_FLAGS=disable-registration enable-login disable-email-verification disable-secure-session-cookies | |
PENPOT_HTTP_SERVER_HOST=0.0.0.0 | |
PENPOT_DATABASE_URI=postgresql://penpot-postgres/penpot | |
PENPOT_DATABASE_USERNAME=penpot | |
PENPOT_DATABASE_PASSWORD=penpot | |
PENPOT_REDIS_URI=redis://penpot-redis/0 | |
PENPOT_ASSETS_STORAGE_BACKEND=assets-fs | |
PENPOT_STORAGE_ASSETS_FS_DIRECTORY=/opt/data/assets | |
PENPOT_TELEMETRY_ENABLED=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
--- | |
version: "3.5" | |
networks: | |
penpot: | |
volumes: | |
penpot_postgres_data: | |
penpot_assets_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
export function* range(start: number, stop: number, step: number = 1): Generator<number> { | |
if (stop == null) { | |
// one param defined | |
stop = start; | |
start = 0; | |
} | |
for (let i = start; step > 0 ? i < stop : i > stop; i += step) { | |
yield i; | |
} |