Skip to content

Instantly share code, notes, and snippets.

View hyouuu's full-sized avatar

hyouuu hyouuu

  • Lychee Isle
  • Los Angeles
View GitHub Profile
@hyouuu
hyouuu / gist:8e9e5dc1e3c397d1f72b6abf49b8f514
Created May 16, 2018 09:48
Thread 1: Fatal error: Error raised at top level: ⚠️ PostgreSQL Error: Could not parse Date from binary data type: UNKNOWN 1184. - id: PostgreSQLError.date
// Fluent 2 model - note that in fluent.json I have:
// "idType": "uuid",
// "keyNamingConvention": "camelCase"
import Foundation
import Vapor
import FluentProvider
import HTTP
final class User: Model {
@hyouuu
hyouuu / test.swift
Last active May 9, 2019 22:48
Test
func test() {
}
/*
Since CloudKit doesn't provide a way to query all recordIDs, we should keep that info in a Meta record so that we can efficiently maintain in sync.
A Meta record will have a String field "recordNames", which contains a list of record names like:
{title}___note_{UUID}___{update}___deleted
{title}___note_{UUID}___{update}
{title}___note_{UUID}__media_{mediaUUID}___{update}
{title}___note_{UUID}__media_{mediaUUID}_data___{update}
At init we fetch the Meta to compile the recordNames, then when we write or delete records, update the Meta and upload. We listen to changes to it and update our local copy.
//
// CKSyncHandler+SyncHandlerDelegate.swift
// Pendo
//
// Created by Shawn Gong on 5/29/19.
// Copyright © 2019 Lychee Isle. All rights reserved.
//
import CloudKit
extension CKSyncHandler: SyncHandlerDelegate {
@hyouuu
hyouuu / PrefabPoolCo.cs
Created October 24, 2022 07:12
PrefabPoolCo
using UnityEngine;
public class PrefabPoolCo : MonoBehaviour {
// singleton for easier access from other scripts
public static PrefabPoolCo one;
[Header("Settings")] public GameObject prefab;
public int initialSize = 300;
public int exhaustionSize = 30;
public int sizeToAddWhenExhausted = 100;
private void SceneManager_OnClientLoadedStartScenes(NetworkConnection conn, bool asServer)
{
Debug.Log("GameCo SceneManager_OnClientLoadedStartScenes asServer:" + asServer);
if (!asServer)
return;
// NetworkObject nob = _networkManager.GetPooledInstantiated(banPrefab, true);
// NetworkObject nob = conn.FirstObject;
// nob.transform.SetPositionAndRotation(position, rotation);
This file has been truncated, but you can view the full file.
2023-02-23 23:27:01.182042+0800 Reclip[93132:14682950] [Reclip] LibraryDataSource:323:collectionView(_:didSelectItemAt:): [Debug] didSelect Reclip at index path: section 0, index 2
2023-02-23 23:27:01.183 Reclip[93132:14682950] LibraryDataSource:323:collectionView(_:didSelectItemAt:): [Debug] didSelect Reclip at index path: section 0, index 2
ReclipEditingSession:44:init(reclip:notificationRouter:store:transcriptStore:): [Info] reclipeditingsession new reclip: receive subscription: (PublishedSubject)
ReclipEditingSession:44:init(reclip:notificationRouter:store:transcriptStore:): [Info] reclipeditingsession new reclip: request unlimited
ReclipEditingSession:44:init(reclip:notificationRouter:store:transcriptStore:): [Info] reclipeditingsession new reclip: receive value: (AlgoliaReclip(id: Optional(63f4fff839761fe25cecbd31), userId: 62fae00413a8e0fb0725b43b, sourceId: 9C19351A-ECB6-4C91-A5FD-AB35D263424A, _title: Prelude.NullCodable<Swift.String>(wrappedValue: Optional("")), _titleAuto: Models.NonEmptyStringNull
2023-03-01 15:41:40.300 Reclip[14626:16722580] ReclipCanvasView:254:updateCoverPhotoIfNeeded(_:): [Info] updateCoverPhotoIfNeeded:Optional(Models.AnyCoverPhotoShape(source: Prelude.OptimisticModel<Foundation.URL>.synced(https://storage.googleapis.com/develop-cover-photos/63f1e88a456272331f2aa8d5), isVisible: true)) sourceId:BE9C80F7-A82A-4526-AFC3-56436E3883C2 local:Optional(Models.AnyCoverPhotoShape(source: Prelude.OptimisticModel<Foundation.URL>.synced(https://storage.googleapis.com/develop-cover-photos/63f1e88a456272331f2aa8d5), isVisible: true))
ReclipEditingSession:44:init(reclip:notificationRouter:store:transcriptStore:): [Info] reclipeditingsession new reclip: receive value: (AlgoliaReclip(id: Optional(63ff019059d16f39da3d23d7), userId: 62fae00413a8e0fb0725b43b, sourceId: 0889CFD8-FD6B-4676-A253-DBFA4E2D9A99, _title: Prelude.NullCodable<Swift.String>(wrappedValue: Optional("")), _titleAuto: Models.NonEmptyStringNullable(wrappedValue: nil), _text: Models.NonEmptyStringNullable(wrappedValue: nil), crea
@hyouuu
hyouuu / gist:0419f7a91763691a3f27a2eacf4d5f65
Created March 2, 2023 08:52
Transcript for A4B688AB-6C2D-425A-9415-EC185699B242
yy trans:Optional(Models.ReclipTranscript(sourceId: A4B688AB-6C2D-425A-9415-EC185699B242, blocks: [Models.API.Transcript.Block(text: "", start: 0.0, end: 0.36180904522613067), Models.API.Transcript.Block(text: "So", start: 0.36180904522613067, end: 0.5628140703517588), Models.API.Transcript.Block(text: "we", start: 0.5628140703517588, end: 0.6834170854271356), Models.API.Transcript.Block(text: "were", start: 0.6834170854271356, end: 0.8040201005025126), Models.API.Transcript.Block(text: "supposed", start: 0.8040201005025126, end: 1.2261306532663316), Models.API.Transcript.Block(text: "to", start: 1.2261306532663316, end: 1.5075376884422111), Models.API.Transcript.Block(text: "go", start: 1.5075376884422111, end: 1.5879396984924623), Models.API.Transcript.Block(text: "on", start: 1.5879396984924623, end: 1.728643216080402), Models.API.Transcript.Block(text: "a", start: 1.728643216080402, end: 1.7889447236180904), Models.API.Transcript.Block(text: "date", start: 1.7889447236180904, end: 1.9899497487437185), Mod
LibraryViewController:262:toggleHighlightsEntry(show:): [Info] LibraryViewController toggleHighlightsEntry no superView - delay 3s
2023-03-13 07:32:31 +0000:AudioPlayer:279:pause(updatingState:): [Debug] _pause source:Optional(C44108D7-0D10-4D37-822F-04DAF9309AC1)
2023-03-13 07:32:31 +0000:AudioPlayer:279:pause(updatingState:): [Debug] _pause source:Optional(C44108D7-0D10-4D37-822F-04DAF9309AC1)
2023-03-13 07:32:31 +0000:AudioPlayer:307:seek(to:): [Debug] applying seek 0.0 source:Optional(C44108D7-0D10-4D37-822F-04DAF9309AC1)
2023-03-13 07:32:31 +0000:AudioPlayer:126:play(to:fadeInTime:): [Debug] _play to:Optional(__C.CMTime(value: 4405147392, timescale: 1000000000, flags: __C.CMTimeFlags(rawValue: 3), epoch: 0)) source:Optional(C44108D7-0D10-4D37-822F-04DAF9309AC1)
AudioPlayerController:252:play(from:to:resetTimeOnPause:fadeInTime:): [Info] _play() was a no-op. continuing on with previously scheduled playbackState
2023-03-13 07:32:31 +0000:EditorSessionLogger:101:sessionDidStart(reason:): [Debug] Editor sess