Skip to content

Instantly share code, notes, and snippets.

View kyeongan's full-sized avatar

Karl Kwon kyeongan

View GitHub Profile
#!/bin/bash
# gif_to_mp4_5x.sh
# Convert GIF to 5x speed MP4 using ffmpeg.
INPUT="$1"
BASENAME=$(basename "$INPUT" .gif)
SPEED=1
PTS=$(awk "BEGIN{print 1/$SPEED}")
WIDTH=1000 # Desired output width (px)
@kyeongan
kyeongan / make_gif_5x.sh
Created April 23, 2025 01:27
Shell script to convert .mov video files into 5x speed, optimized GIFs using ffmpeg with palette generation for quality and size efficiency.
#!/bin/bash
# make_gif_5x.sh
# Convert a .mov file into an optimized 5x speed animated GIF using ffmpeg and palette method.
# Usage:
# ./make_gif_5x.sh input.mov
INPUT="$1"
BASENAME=$(basename "$INPUT" .mov)
@kyeongan
kyeongan / ffmpeg commend
Last active April 23, 2025 00:57
Video to GIFs using FFmpeg (ffmpeg commend)
# ffmpeg commend for generating gif
brew install ffmpeg imagemagick
ffmpeg -i input.mov -vf scale=1000:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 5 -loop 0 - output.gif
@kyeongan
kyeongan / .zshrc
Last active April 16, 2025 16:27
Zsh config
# Load Homebrew environment variables
export HOMEBREW_NO_INSTALL_CLEANUP=1
eval "$(/opt/homebrew/bin/brew shellenv)"
export GREP_OPTIONS='--color=auto'
# Optimize History Behavior
setopt HIST_IGNORE_ALL_DUPS # Ignore duplicates in history
setopt HIST_SAVE_NO_DUPS # Do not write duplicate commands to history
setopt HIST_REDUCE_BLANKS # Remove unnecessary spaces in commands
@kyeongan
kyeongan / config
Created January 13, 2020 03:11
ssh config
#This is my personal setting
#Github
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
#<CompanyName>
Host <CompanyName>
HostName bitbucket.org
@kyeongan
kyeongan / .bashrc
Last active November 1, 2019 17:07
Bash config
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
export HISTSIZE=10000
export PS1="\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;34m\]\w\[\e[0m\]\$ "
# PATH
export PATH=/Users/kkwon/Library/Python/2.7/bin:$PATH
export PATH="~/Downloads/applications/Sublime Text.app/Contents/SharedSupport/bin":$PATH
export PATH="~/Downloads/applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin":$PATH
@kyeongan
kyeongan / minesweeper.py
Created March 7, 2019 15:50
minesweeper board generation and bomb generation.
import numpy as np;
ROW_COUNT = 5
COL_COUNT = 5
BOMES_COUNT = (ROW_COUNT * COL_COUNT) / 4
def create_board():
"""
create a board
"""
@kyeongan
kyeongan / search_value_in_2d_array.py
Last active February 1, 2019 22:01
Write a function to return True or False if the target value is in the 2d array.
# Write a function to return True or False if the target value is in the 2d array.
data = [
[1, 3, 5, 7, 9, 10],
[3, 4, 6, 9, 10, 13],
[6, 8, 10, 12, 14, 16],
[10, 12, 14, 16, 18, 20],
[22, 23, 24, 25, 26, 27]
]
function minimumMovement(obstacleLanes) {
// Write your code here
// console.log(obstacleLanes)
let currentLine = 2;
let total_move = 0;
var len = obstacleLanes.length;
var i = 0
for (i = 0; i < len; i++) {
let element = obstacleLanes[i]
# initialization file (not found)