Skip to content

Instantly share code, notes, and snippets.

View PeraSite's full-sized avatar

정제훈 PeraSite

  • Soongsil University
  • Seoul, South Korea
View GitHub Profile
@lucas-barake
lucas-barake / event-handler.ts
Last active January 12, 2026 10:44
How I Handle WebSockets in Web Apps
import { Effect, type Schema } from "effect";
export type EventHandler<A, I, X> = {
readonly channel: `/${string}/`;
readonly schema: Schema.Schema<A, I>;
readonly handle: (data: A) => Effect.Effect<void, X, never>;
};
export type InfallibleEventHandler<A, I> = {
[K in keyof EventHandler<A, I, never>]: EventHandler<A, I, never>[K];
@leminlimez
leminlimez / Domains.md
Last active May 8, 2026 23:45
A deep dive into the iOS backup/restore system

Domains.plist

Documentation of /System/Library/Backup/Domains.plist. File taken from iOS 16.4 iPhone SE 3. The file was removed in iOS 17.0

Values

Values in the plist. Other than SystemDomains, these are not really important and are just here for preservation sake.

A domain in domains.plist contains keys that determine what gets backed up for what types of devices and where (i.e. iCloud vs iTunes). Not all domains have each key. The only 2 keys that must be in every domain are RootPath and RelativePathsToBackupAndRestore. Some domains have the value ShouldDigest. I am not sure exactly what it means but I have included it for documentation purposes.

  • Version: "24.0"
  • SystemDomains: (Dictionary), see below
@cayter
cayter / LICENSE
Last active May 4, 2026 09:22
Drizzle ORM Type-Safe Repository With PgTable
MIT License
Copyright (c) 2022-present, cayter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@ikupenov
ikupenov / db-client.ts
Created February 29, 2024 18:40
Intercepting Drizzle db calls
import { and, type DBQueryConfig, eq, type SQLWrapper } from "drizzle-orm";
import { drizzle } from "drizzle-orm/postgres-js";
import postgres, { type Sql } from "postgres";
import { type AnyArgs } from "@/common";
import {
type DbClient,
type DbTable,
type DeleteArgs,
@yasirkula
yasirkula / SceneViewObjectPickerContextWindow.cs
Last active April 8, 2026 11:05
Select the object under the cursor via right click in Unity's Scene window
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using UnityEditor;
using UnityEngine;
using UnityEngine.Pool;
using UnityEngine.UI;
public class SceneViewObjectPickerContextWindow : EditorWindow
@goellner
goellner / socialredirect.php
Created August 17, 2022 12:38
Trick instagram in-app browser to open in system browser
<script type="text/javascript">
// detect instagram in-app browser on android and force a redirect
if(navigator.userAgent.includes("Instagram") && navigator.userAgent.includes("Android")){
var socialsRedirectURL = encodeURIComponent(window.location.href);
window.location.href = "https://yourdomain.example/socialredirect.php?redirect=" + socialsRedirectURL;
}
</script>
@lawrencecchen
lawrencecchen / tinysync.ts
Created July 19, 2022 08:26
A Typescript first queue/job/schedule engine.
// i like trpc. i like autocomplete. i like vercel/serverless.
// netlify acquired quirrel.
// theo would shill for a type safe option.
// there's a gap for a type-safe scheduling/cron/queuing/realtime and i want to fill it.
// also, quirrel has weird syntax for
// framing: typescript-first bindings for what you would typically use redis for
const appRouter = createRouter();
@PeraSite
PeraSite / helper.js
Last active May 21, 2021 00:31
SMC Goorm Helper
// ==UserScript==
// @name SMC Goorm Exam Helper
// @namespace https://github.com/PeraSite/ExamHelper
// @version 0.4
// @description Help to clear exam easier, faster!
// @author JJH / PeraSite
// @match https://smc.goorm.io/exam*
// @icon https://www.google.com/s2/favicons?domain=goorm.io
// @grant none
// ==/UserScript==
using System;
using System.Collections.Generic;
using Sirenix.OdinInspector.Editor;
using Sirenix.OdinInspector.Editor.Validation;
using Sirenix.Utilities.Editor;
using UnityEngine;
[DrawerPriority(0.0, 10000.1)]
public class MiniValidationDrawer<T> : OdinValueDrawer<T>, IDisposable
{
@bgolus
bgolus / StereographicProjectionBubble.shader
Created February 28, 2020 06:33
Modifying UVs using stereographic projection to create the illusion of a sphere.
Shader "Unlit/StereographicProjectionBubble"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_PanSpeed ("Pan Speed", Float) = 0.1
_Spherify ("Spherify", Range(0,1)) = 1
}
SubShader
{