Skip to content

Instantly share code, notes, and snippets.

Avatar

Sumin Byeon suminb

View GitHub Profile
@suminb
suminb / concat.py
Created Dec 30, 2020
Concat GoPro media files
View concat.py
import glob
import os
import sys
def escape(path):
return path.replace(" ", "\ ")
def extract_episode_and_sequence(path):
View fifty_people.html
<!DOCTYPE html>
<html>
<head>
<script src="https://d3js.org/d3.v5.min.js"></script>
<style>
.hover path {
stroke: #ccc;
}
View setup_proxy.sh
#!/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 Nov 19, 2019
I could use this as an example for SBCW
View cached_fetch.py
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:
View crawler.py
"""이 코드를 실행하려면 몇가지 외부 라이브러리가 필요합니다. 다음과 같이 설치할 수 있습니다.
pip install requests beautifulsoup4 logbook
그리고 프로그램을 실행할 때 URL을 하나 넘겨주어야 합니다.
python crawler.py http://...
"""
from collections import deque
View boeing.ipynb
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
Go sort performance test
View sort_test.go
package main
import (
"math/rand"
"sort"
"testing"
)
var n = 600000000
var seq = make([]int, n)
@suminb
suminb / performance_test.py
Last active Mar 22, 2019
Tail Recursion Elimination in Python
View performance_test.py
import timeit
recursive_code = """
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n - 1)
View 상장사 주소.ipynb
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 Nov 5, 2018
WordPress 게시물을 .rst 형식으로 변환하는 스크립트
View convert.py
"""Converts old blog posts (from WordPress) to .rst files."""
import os
import re
import warnings
import pypandoc
import yaml
SOURCE_PATH = 'posts.bak'