Skip to content

Instantly share code, notes, and snippets.

View sangheonhan's full-sized avatar
🤔
Minimalizing...

Sangheon Han sangheonhan

🤔
Minimalizing...
View GitHub Profile
@sangheonhan
sangheonhan / extract_app_names.sh
Created May 3, 2024 05:15
List Installed Mac Applications
#!/bin/bash
# 파일을 저장할 경로 설정
output_file=~/Desktop/Installed_Applications_Names.txt
# 출력 파일이 이미 존재한다면 삭제
rm -f $output_file
# /Applications 폴더 내의 모든 .app 항목에 대해 반복
for app in /Applications/*.app; do
@sangheonhan
sangheonhan / tmux-ssh.sh
Created March 25, 2024 19:09
Creates tmux windows for SSH sessions to given hostnames
#!/bin/bash
current_dir_name=$(basename "$PWD")
session_name=${current_dir_name// /_}
if ! tmux has-session -t "$session_name" 2>/dev/null; then
tmux new-session -d -s "$session_name" -n "${1}" -c "$PWD"
tmux send-keys -t "$session_name" "ssh ${1}" C-m
shift
else
@sangheonhan
sangheonhan / delete_retweet.py
Created May 17, 2023 06:55
Delete all Retweets.
import tweepy
import time
import pprint
def get_all_retweets(api, max_tweets=3200):
user = api.verify_credentials()
retweets = []
retweet_count = 0
@sangheonhan
sangheonhan / set-locale.sh
Created May 3, 2023 08:23
Set Ubuntu to the Korean locale.
#! /bin/bash
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
export LANG=ko_KR.UTF-8
export LC_MESSAGES=POSIX
sed -i 's/archive.ubuntu.com/mirror.kakao.com/g' /etc/apt/sources.list
apt update -y
apt install -y locales language-pack-ko tzdata
@sangheonhan
sangheonhan / github-ip-addr.py
Created March 30, 2023 06:59
The code retrieves and prints a list of GitHub's IP addresses from the meta API endpoint.
import requests
response = requests.get('https://api.github.com/meta')
data = response.json()
ip_addresses = data['hooks']
print(ip_addresses)
@sangheonhan
sangheonhan / dark-theme.css
Created May 11, 2022 01:19
Just Read - 다크 테마 (한글 가독성을 위해 수정)
@font-face {
font-family: 'Source Sans Pro Semibold';
src: url("chrome-extension://dgmanlpmmkibanfdgjocnabmcaclkmod/fonts/SourceSansPro-Semibold.ttf");
}
@font-face {
font-family: 'Source Sans Pro Bold';
src: url("chrome-extension://dgmanlpmmkibanfdgjocnabmcaclkmod/fonts/SourceSansPro-Bold.ttf");
}
@sangheonhan
sangheonhan / .minttyrc
Last active January 26, 2021 00:44
Mintty setting (Solarized Dark Theme)
Font=Bitstream Vera Sans Mono for Po
FontHeight=12
BoldAsFont=no
BoldAsColour=no
AllowBlinking=yes
Locale=ko_KR
Charset=UTF-8
Columns=120
Rows=40
Language=@
@sangheonhan
sangheonhan / TrueColour.md
Created January 19, 2021 00:43 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
@sangheonhan
sangheonhan / 24-bit-color.sh
Created January 12, 2021 05:05
터미널 에뮬레이터 256 색상 지원 확인 스크립트
#!/bin/bash
# This file was originally taken from iterm2 https://github.com/gnachman/iTerm2/blob/master/tests/24-bit-color.sh
#
# This file echoes a bunch of 24-bit color codes
# to the terminal to demonstrate its functionality.
# The foreground escape sequence is ^[38;2;<r>;<g>;<b>m
# The background escape sequence is ^[48;2;<r>;<g>;<b>m
# <r> <g> <b> range from 0 to 255 inclusive.
# The escape sequence ^[0m returns output to default
@sangheonhan
sangheonhan / alacritty.yml
Created January 12, 2021 05:01
Alacritty 설정
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Import additional configuration files
#
# These configuration files will be loaded in order, replacing values in files
# loaded earlier with those loaded later in the chain. The file itself will
# always be loaded last.
#import:
# - /path/to/alacritty.yml