Skip to content

Instantly share code, notes, and snippets.

View Poxios's full-sized avatar
🥳
Happy

YoungHyun Cho Poxios

🥳
Happy
  • Seoul, South Korea
  • Instagram 0hyun.c
View GitHub Profile
@Poxios
Poxios / jungsan.ts
Created January 26, 2024 00:58
jungsan
const participants = ["은소", "종민", "의정", "연우", "서윤", "준하", "영현"]
type participants = typeof participants[number]
const events: { label: string, cost: number, target: participants[] }[] = [
{ label: "하나로1", cost: 58_280, target: ["은소", "종민", "의정", "연우", "서윤", "준하", "영현"] },
{ label: "하나로2", cost: 93_250, target: ["은소", "종민", "의정", "연우", "서윤", "준하", "영현"] },
{ label: "주유비", cost: 61_800, target: ["종민", "연우", "서윤", "준하", "영현"] },
{ label: "싼타클로스 햄버거", cost: 96_500, target: ["은소", "종민", "의정", "연우", "서윤", "준하", "영현"] },
{ label: "바베큐", cost: 30_000, target: ["은소", "종민", "의정", "연우", "서윤", "준하", "영현"] },
{ label: "씨유 (얼음, 음료수)", cost: 7_800, target: ["은소", "종민", "의정", "연우", "서윤", "준하", "영현"] },
{ label: "톨게이트", cost: 7_200, target: ["종민", "연우", "서윤", "준하", "영현"] },
@Poxios
Poxios / sqlalchemy_example.py
Created November 7, 2023 16:47 — forked from ronreiter/sqlalchemy_example.py
SQLAlchemy Example
from sqlalchemy import Column, Integer, String, ForeignKey, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, backref, sessionmaker, joinedload
# For this example we will use an in-memory sqlite DB.
# Let's also configure it to echo everything it does to the screen.
engine = create_engine('sqlite:///:memory:', echo=True)
# The base class which our objects will be defined on.
Base = declarative_base()
@Poxios
Poxios / jungsan.py
Created October 30, 2023 05:00
jungsan
p = {
"영현": 0,
"승언": 0,
"준하": 0,
"종민": 0,
"관록": 0,
"도윤": 0,
"동형": 0,
"준혁": 0,
"형준": 0,
@Poxios
Poxios / ArchOracleCloud.md
Created October 12, 2023 06:55 — forked from amishmm/ArchOracleCloud.md
Install Arch Linux on Oracle Cloud (Free Tier)

Requirement

  • Console / Cloud Shell access (via https://cloud.oracle.com)
  • Go to the instance page and under Resources -> Console connection -> Launch Cloud Shell connection

Steps

  1. In Ubuntu OR any other Free tier Linux OS
# Download Alpine Linux and install it on disk
cd /
wget https://dl-cdn.alpinelinux.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.2-x86_64.iso
@Poxios
Poxios / I'm an early 🐤
Last active November 14, 2023 00:04
I'm an early 🐤
🌞 Morning 43 commits █▋░░░░░░░░░░░░░░░░░░░ 7.9%
🌆 Daytime 271 commits ██████████▍░░░░░░░░░░ 49.7%
🌃 Evening 209 commits ████████░░░░░░░░░░░░░ 38.3%
🌙 Night 22 commits ▊░░░░░░░░░░░░░░░░░░░░ 4.0%
@Poxios
Poxios / convert1.sh
Created September 6, 2023 16:25 — forked from zengxinhui/convert2arch_arm.sh
Replace Oracle Cloud Linux with Arch Linux ARM remotely
Refs:
1. http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz
2. https://dl-cdn.alpinelinux.org/alpine/v3.13/releases/aarch64/alpine-virt-3.13.5-aarch64.iso
3. https://wiki.alpinelinux.org/wiki/Replacing_non-Alpine_Linux_with_Alpine_remotely
4. https://wiki.archlinux.org/index.php/installation_guide#Configure_the_system
5. https://archlinuxarm.org/platforms/armv8/generic
Requirement:
Console access.
@Poxios
Poxios / simple text bar.md
Created November 26, 2022 05:26
Simple text bar python

Simple text bar (graph) with python

def generate_text_bar_graph(length: int, min_value: int, score: int, max_value: int):
    if score <= min_value:
        return f'[{min_value}{"―"*(length-1)} {max_value}]'
    elif max_value <= score:
        return f'[{min_value} {"―"*(length-1)}{max_value}]'

    def roundUp(num: int): return int(num) + \
 1 if (num - int(num)) &gt;= 0.5 else int(num)
@Poxios
Poxios / traefik-with-https-docker-compose.yml
Created November 3, 2022 06:50
Full docker-compose file for Traefik with secure settings
# Simple docker-compose file example for Traefik
# Feature: Let's encrypt(ACME), Log(Debug level), Secure Dashboard(https connection, require password), Redirect http requests to https, Example docker container connection(whoami)
# @Poxios, 2022
version: '3'
services:
reverse-proxy:
image: traefik
container_name: reverse-proxy
@Poxios
Poxios / aligning-images.md
Created September 19, 2022 05:44 — forked from DavidWells/aligning-images.md
Guide to aligning images in github readme.md files. https://davidwells.io/snippets/how-to-align-images-in-markdown

Aligning images

left alignment

This is the code you need to align images to the left:

@Poxios
Poxios / throw-error-on-timeout.ts
Created August 13, 2022 02:04
Throw Error on Timeout (Typescript)
export async function timeout<T>(promise: Promise<T>, ms: number): Promise<T> {
let timer: NodeJS.Timeout;
const res = await Promise.race([
promise,
new Promise<'timeout'>(resolve => {
timer = setTimeout(() => resolve('timeout'), ms);
})
] as const).finally(() => clearTimeout(timer));
if (res === 'timeout') {