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):
<!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
Loading
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)
@suminb
suminb / performance_test.py
Last active March 22, 2019 03:29
Tail Recursion Elimination in Python
import timeit
recursive_code = """
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n - 1)
@suminb
suminb / 상장사 주소.ipynb
Created December 1, 2018 16:00
상장사 주소 가져오기
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@suminb
suminb / convert.py
Last active November 5, 2018 16:25
WordPress 게시물을 .rst 형식으로 변환하는 스크립트
"""Converts old blog posts (from WordPress) to .rst files."""
import os
import re
import warnings
import pypandoc
import yaml
SOURCE_PATH = 'posts.bak'