Skip to content

Instantly share code, notes, and snippets.

View jinwoo1225's full-sized avatar
🥕

Hong Jinwoo (Carter) jinwoo1225

🥕
  • Anyang-si,South Korea
  • 21:22 (UTC +09:00)
View GitHub Profile
@jinwoo1225
jinwoo1225 / patch-edid.md
Created July 18, 2023 13:46 — forked from ejdyksen/patch-edid.md
A script to fix EDID problems on external monitors in macOS

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):

@jinwoo1225
jinwoo1225 / mon.go
Created October 28, 2021 06:31
MongoDB integration
// https://www.mongodb.com/blog/post/quick-start-golang-mongodb-starting-and-setup
func main() {
client, err := mongo.NewClient(options.Client().ApplyURI("<ATLAS_URI_HERE>"))
if err != nil {
log.Fatal(err)
}
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
err = client.Connect(ctx)
if err != nil {
log.Fatal(err)
@jinwoo1225
jinwoo1225 / len_string.go
Created October 26, 2021 06:04
go lang length of string
package main
import (
"fmt"
"strings"
)
func main() {
//https://golang.org/doc/effective_go#for
@jinwoo1225
jinwoo1225 / PyQt6.sh
Created August 22, 2021 07:41
Install PyQt6 on macOS for M1 (Apple Silicon) Devices
#!/bin/bash
# Assumes brew and python are installed
brew install qt@6 llvm cmake ninja git
# Setup environment
mkdir -p ~/.pyqt6; cd ~/.pyqt6
curl https://files.pythonhosted.org/packages/a0/07/0ae4f67768c1150af851572fae287aeaf956ed91b3b650b888a856274ae4/PyQt6-6.1.1.tar.gz --output PyQt6-6.1.1.tar.gz
curl https://files.pythonhosted.org/packages/50/24/743c4dd6a93d25570186a7940c4f072db1cf3fa919169b0ba598fcfc820a/PyQt6_sip-13.1.0.tar.gz --output PyQt6_sip-13.1.0.tar.gz
curl https://files.pythonhosted.org/packages/ea/5e/4c954451984d00dfc051eab5c4b40453923a85f5a0dfa9678511d06eec5e/PyQt6_3D-6.1.1.tar.gz --output PyQt6_3D-6.1.1.tar.gz
curl https://files.pythonhosted.org/packages/b9/ac/9c545186f3125b0fb02359938bddde0167344f3d4e14aee17fa122b5287a/PyQt6_Charts-6.1.1.tar.gz --output PyQt6_Charts-6.1.1.tar.gz
import heapq
# https://justkode.kr/algorithm/python-dijkstra
def dijkstra(graph: dict, start: int) -> dict:
distances = {node: float('inf') for node in graph}
distances[start] = 0
queue = []
heapq.heappush(queue, [distances[start], start])
def fast_pow(n: int, k: int, mod: int) -> int:
"""
faster power that uses Divide & Conquer
:param n: base
:param k: count
:param mod: modular
:return: powered n to k
"""
if n == 0:
raise ArithmeticError("n can't be 0")
def karatsuba(x: int, y: int) -> int:
# get Length of variable
x_str, y_str = str(x), str(y)
x_len, y_len = len(x_str), len(y_str)
# Initialize
if x_len == 1 or y_len == 1:
return x * y
# Divide
#include<stdio.h>
int main(void)
{
printf("Hello,World\n");
return 0;
}