Skip to content

Instantly share code, notes, and snippets.

View cometkim's full-sized avatar
๐Ÿ›Œ
sleeping

Hyeseong Kim cometkim

๐Ÿ›Œ
sleeping
View GitHub Profile
@steveruizok
steveruizok / 1_getEllipseSegmentIntersections.ts
Last active May 13, 2022 06:33
Find the point(s) where a line segment intersects an ellipse.
/**
* Find the point(s) where a line segment intersects an ellipse.
* @param x0 The x-axis coordinate of the line's start point.
* @param y0 The y-axis coordinate of the line's start point.
* @param x1 The x-axis coordinate of the line's end point.
* @param y1 The y-axis coordinate of the line's end point.
* @param cx The x-axis (horizontal) coordinate of the ellipse's center.
* @param cy The y-axis (vertical) coordinate of the ellipse's center.
* @param rx The ellipse's major-axis radius. Must be non-negative.
@alexanderson1993
alexanderson1993 / app.tsx
Last active April 19, 2021 15:10
Deno React SSR
import {
React,
} from "https://unpkg.com/es-react";
declare global {
namespace JSX {
interface IntrinsicElements {
h1: any;
div: any;
h2: any;
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active August 23, 2026 14:12
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

WARNING: Article moved to separate repo to allow users contributions: https://github.com/raysan5/custom_game_engines

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like [Unreal](https:

@sibelius
sibelius / applyMiddleware.ts
Created April 7, 2020 11:55
trace resolver to generate span for each GraphQL resolver
import { addMiddleware } from 'graphql-add-middleware';
addMiddleware(schema, traceResolveMiddleware);
@bvaughn
bvaughn / useSubscription-and-useMutableSource.md
Last active December 29, 2021 02:12
`useSubscription` and `useMutableSource` tearing and deopt behavior.

useSubscription and useMutableSource1 tearing and deopt behavior.

Mounting a new tree

The tree below represents a React application mounting. During mount, two components read from an external, mutable source. The first one (List) reads version 1 of that data and the second one (Item) reads version 2.

Deopt

useSubscription (legacy mode)

N/A.

@MichaelSimons
MichaelSimons / RetrievingDockerImageSizes.md
Last active July 28, 2026 15:05
Retrieving Docker Image Sizes

Retrieving Docker Image Sizes

There are two metrics that are important to consider when discussing the size of Docker images.

  1. Compressed size - This is often referred to as the wire size. This affects how fast/slow images can be pulled from a registry. This impacts the first run experience on machines where images are not cached.
  2. Uncompressed size - This is often referred to as the size on disk. This affects how much local storage is required to support your Docker workloads.

The example commands shown below will work on Windows, MacOS, and Linux.

How to Measure the Compressed Size

const bypass = [
// function names to avoid logging
];
const collapsed = [
// function names to groupCollapsed
];
module.exports = function(babel) {
const { types: t } = babel;
const wrapFunctionBody = babel.template(`{
// This is a proper alternative to
// https://github.com/BuckleScript/bucklescript/blob/b9508105b1a35537bdea9a1fabd10f6c65f776b4/jscomp/bsb/templates/react-hooks/src/FetchedDogPictures/FetchedDogPictures.re#L14
// The one in that file uses Promise, but that's *wrong*.
// We only used promise as a demo of its API. We'll remove it soon.
// As you can see below, the pure XMLHttpRequest code is just as clean,
// less mysterious for all, more performant, extensible, and actually correct.
// Ignore these externals for now. They're just for illustration
// purposes. I just copy pasted the Js code from
@rabelais88
rabelais88 / docker-swarm.md
Created November 10, 2019 05:18
์Šคํƒ€ํŠธ์—…์— traefik + docker-swarm์„ ์ถ”์ฒœํ•˜๋Š” ์ด์œ 

์Šคํƒ€ํŠธ์—…์— traefik + docker-swarm์„ ์ถ”์ฒœํ•˜๋Š” ์ด์œ 

  • Traefik: Reverse-proxy router
  • Docker-swarm: Docker-supported orchestrator

์™œ Docker-Swarm์ธ๊ฐ€?

  • kubernetes(์ดํ•˜ k8) ๋Š” ๋ฌด๊ฒ๊ณ  ๋А๋ฆฌ๋‹ค. docker-swarm(์ดํ•˜ DS) ์€ docker ์ตœ์‹ ๋ฒ„์ „์— ๊ธฐ๋ณธ์œผ๋กœ ํƒ‘์žฌ๋˜์–ด ๋‚˜์˜จ๋‹ค. ๋˜ํ•œ helm์ด๋‚˜ ๋ณ„๋„์˜ ๊ด€๋ฆฌ cli(kubeadm, kubectl)๋ฅผ ์„ค์น˜ํ•  ํ•„์š”๊ฐ€ ์—†๋‹ค.

  • k8 ์€ ์„ธํŒ…๋„ ์–ด๋ ต๋‹ค: ์„ธํŒ…ํ•˜๊ธฐ๊ฐ€ ์›Œ๋‚™ ๊นŒ๋‹ค๋กœ์›Œ ์‹ค์ œ๋กœ ์šด์˜ํ•˜๊ธฐ ์ ์ ˆํ•œ ๊ฒฝ์šฐ๋Š” devops ํŒ€์„ ๊ฐ€์ง„ ์ตœ์†Œ 20๋ช… ์ด์ƒ์˜ ๋Œ€๊ทœ๋ชจ ์‚ฌ์ด์ฆˆ ํŒ€์ด๋‹ค. ํ•œ ๋ช…์ด ์ž‘์—…ํ•˜๋Š” ๊ฒƒ์ด ์•„์ฃผ ๋ถˆ๊ฐ€๋Šฅํ•œ ๊ฒƒ์€ ์•„๋‹ˆ์ง€๋งŒ, ๊ธด๊ธ‰์ˆ˜์ •์‹œ์—๋Š” ๋งŽ์ด ์œ„ํ—˜ํ•ด์งˆ ์ˆ˜ ์žˆ๋‹ค. ์ด์›์ด 10๋ช…์ด ๋˜์ง€ ์•Š๋Š” ์šฐ๋ฆฌํŒ€ ๊ฐ™์€ ๊ฒฝ์šฐ๋Š” ํ•œ ์‚ฌ๋žŒ์ด ๊ธ‰ํ•˜๊ฒŒ ๊ธฐ๋Šฅ์ˆ˜์ •์„ ํ•ด์•ผ๋  ์ผ์ด ๋งŽ๋‹ค.

@notakaos
notakaos / create_function_plv8_cuid.sql
Last active August 16, 2024 10:10
cuid for PostgreSQL with PL/v8
-- original code: https://github.com/ericelliott/cuid
-- Add the "plv8" extension
create extension if not exists "plv8";
-- Add the "pgcrypto" extension
create extension if not exists "pgcrypto";
\dx
-- Connect a database