This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import os | |
import sys | |
def escape(path): | |
return path.replace(" ", "\ ") | |
def extract_episode_and_sequence(path): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://d3js.org/d3.v5.min.js"></script> | |
<style> | |
.hover path { | |
stroke: #ccc; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""이 코드를 실행하려면 몇가지 외부 라이브러리가 필요합니다. 다음과 같이 설치할 수 있습니다. | |
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"math/rand" | |
"sort" | |
"testing" | |
) | |
var n = 600000000 | |
var seq = make([]int, n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
recursive_code = """ | |
def factorial(n): | |
if n == 0: | |
return 1 | |
else: | |
return n * factorial(n - 1) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Converts old blog posts (from WordPress) to .rst files.""" | |
import os | |
import re | |
import warnings | |
import pypandoc | |
import yaml | |
SOURCE_PATH = 'posts.bak' |
NewerOlder