Skip to content

Instantly share code, notes, and snippets.

View RanolP's full-sized avatar
🤓
Otaku save the world

RanolP RanolP

🤓
Otaku save the world
View GitHub Profile
@RanolP
RanolP / logo-creator.html
Created December 11, 2022 05:55
개발자 수다방 로고 생성기 응모 작품 (탈락)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>개수다 로고 생성기</title>
<style>
/* RESET */
@RanolP
RanolP / prism2curse.mjs
Last active November 7, 2022 14:03
Prism 런처의 기기묘묘한 .index 폴더와 mmc-pack.json을 잘 탐구해서 Curseforge 모드팩을 만들어보자
import { promises as fs } from 'node:fs';
import { join } from 'node:path';
const MODPACK_VERSION = '';
const MODPACK_AUTHOR = '';
const MODPACK_NAME = '';
const mmcPack = JSON.parse(
await fs.readFile('mmc-pack.json', { encoding: 'utf8' })
);
@RanolP
RanolP / Granola.c
Last active June 8, 2022 02:09
놀라운 그래프 C 단일 파일
/*
* y = f(x) 꼴의 그래프를 그리는 프로그램입니다.
* 이 파일을 빌드하기 위해서는 gdi32가 필요합니다.
* Dev C++ 기준
* 1. 파일 > 새로 만들기 > 프로젝트 에서 Console Application을 만듭니다.
* 2. 해당 프로젝트가 열린 상태에서, 프로젝트 > 프로젝트 옵션을 열고, 매개변수들 탭에서 Linker 칸에 "-lgdi32" (따옴표 안의 것)을 넣습니다.
*
* 사용 방법
* 1. y = f(x)의 그래프에서 f(x)에 해당하는 부분을 입력합니다.
* 이 때, 연산자 우선순위는 적용되지 않으며 왼쪽부터 결합됩니다
@RanolP
RanolP / iosevka-nf-concentrator.mjs
Last active June 4, 2022 04:48
Download, Unzip, Classify.
import { promises as fs, constants as FS } from 'node:fs';
import { exec } from 'node:child_process';
import { promisify } from 'node:util';
import path from 'node:path';
const ColorRegex = /(?:\\([fFbB])([0-9]))|(\\0)/g;
function echo(templates, ...params) {
console.log(
String.raw(templates, ...params)
.replaceAll(ColorRegex, (_, fb, id, zero) =>
const BoundType = Object.freeze({
Included: 'bound_type::included',
Excluded: 'bound_type::excluded',
});
class Bound {
constructor(type, value) {
this.type = type;
this.value = value;
}
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Preact Quickstart</title>
</head>
<body>
<script type="module">
import { html, render, useState, useEffect } from 'https://cdn.skypack.dev/htm@3.0.4/preact/standalone';
@RanolP
RanolP / rke.ts
Last active May 7, 2022 13:55
rke(I like to call it '갇'), Replace Korean Entities
type TailId = -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27;
function tailIdOf(word: string): TailId {
if (word.length === 0) {
return -1;
}
const last = word[word.length - 1];
if (last < '가' || '힣' < last) {
return -1;
}
@RanolP
RanolP / josa-ext.ts
Created August 23, 2020 13:00
조사를 조사하세요
type TailId = -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27;
function tailIdOf(word: string): TailId {
if (word.length === 0) {
return -1;
}
const last = word[word.length - 1];
if (last < '가' || '힣' < last) {
return -1;
}
@RanolP
RanolP / rust_ps_input.rs
Last active July 10, 2020 04:33
Easier input processing in Rust when Problem Solving
//! This is free and unencumbered software released into the public domain.
//!
//! Anyone is free to copy, modify, publish, use, compile, sell, or
//! distribute this software, either in source code form or as a compiled
//! binary, for any purpose, commercial or non-commercial, and by any
//! means.
//!
//! In jurisdictions that recognize copyright laws, the author or authors
//! of this software dedicate any and all copyright interest in the
//! software to the public domain. We make this dedication for the benefit
@RanolP
RanolP / inverse-type.ts
Last active November 19, 2019 02:01
I'd like to introduce the `Inverse` type in TypeScript.
// For Readibility, I've separated it into type.
type Keyable = string | number | symbol;
// Get value union type.
// for `{ a: true, b: 3 }` it will give you `boolean | number` type.
// Also for array, it will give you commonest type of the array.
type GetValueUnion<T> = T[keyof T];
// This type will inverse keys and values.
// for `{ a: 'str', b: 3 }` it will give you `{ 3: 'b', str: 'a' }` type.