Skip to content

Instantly share code, notes, and snippets.

View PeraSite's full-sized avatar

정제훈 PeraSite

  • Soongsil University
  • Seoul, South Korea
View GitHub Profile
@PeraSite
PeraSite / claude_3.5_sonnet_artifacts.xml
Created June 25, 2024 10:17 — forked from dedlim/claude_3.5_sonnet_artifacts.xml
Claude 3.5 Sonnet, Full Artifacts System Prompt
<artifacts_info>
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity.
# Good artifacts are...
- Substantial content (>15 lines)
- Content that the user is likely to modify, iterate on, or take ownership of
- Self-contained, complex content that can be understood on its own, without context from the conversation
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations)
- Content likely to be referenced or reused multiple times
@PeraSite
PeraSite / useAsync.ts
Last active February 3, 2023 14:18
Typesafe async hook for React and Typescript
import { useReducer, useEffect } from 'react';
interface State<TData> {
loading: boolean;
data?: TData | null;
error?: unknown | null;
}
interface Action<TData> {
type: 'LOADING' | 'SUCCESS' | 'ERROR';
@PeraSite
PeraSite / winapi.cpp
Created August 31, 2022 06:18
베이스 Wn32 API 코드
#include <windows.h>
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
HINSTANCE g_hInst;
LPCTSTR lpszClass = TEXT("First");
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow) {
HWND hWnd;
MSG Message;
WNDCLASS WndClass;
@PeraSite
PeraSite / helper.js
Last active May 21, 2021 00:31
SMC Goorm Helper
// ==UserScript==
// @name SMC Goorm Exam Helper
// @namespace http://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==
@PeraSite
PeraSite / IntCompressor.java
Created February 11, 2018 07:46
Compress multiple int to one int
import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class IntCompressor {
public static int compress(int... data) {
int[] compressedArr = new int[data.length - 1];
for (int i = 0; i <= data.length - 2; i++) {