$ python setup.py build
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 get_func_closure(func): | |
try: | |
return func.__closure__ | |
except AttributeError: | |
# Python < 2.6 | |
return func.func_closure | |
def undecorator(func): | |
return get_func_closure(func)[0].cell_contents |
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 datetime | |
def get_last_sunday(dt: datetime.datetime) -> datetime.datetime: | |
""" | |
ある時刻が与えられたとき、その時刻を前回の日曜の15時に変換する | |
>>> get_last_sunday(datetime.datetime(2022, 12, 13, 2, tzinfo=datetime.timezone.utc)) | |
datetime.datetime(2022, 12, 11, 15, 0, tzinfo=datetime.timezone.utc) | |
>>> get_last_sunday(datetime.datetime(2022, 12, 18, 14, 0, tzinfo=datetime.timezone.utc)) |
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
# -*- coding: utf-8 -*- | |
from docutils import nodes | |
from sphinx import addnodes | |
import sphinx.ext.refcounting | |
IGNORE_NODES = ( | |
# comment | |
nodes.comment, |
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
export CUDA_HOME=/usr/local/cuda | |
export NVIDIA_HOME=/usr/local/nvidia | |
export PATH=${CUDA_HOME}/bin:${PATH} | |
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_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
% Takaoフォントファミリー | |
%% 明朝系 | |
rml H TakaoMincho.ttf | |
rmlv V TakaoMincho.ttf | |
rml-jis H TakaoMincho.ttf | |
%% ゴシック系 | |
gbm H TakaoGothic.ttf | |
gbm V TakaoGothic.ttf | |
gbm-jis H TakaoGothic.ttf |
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 re | |
import operator | |
import json | |
import requests | |
import lxml.etree | |
import lxml.html | |
def collect_global_vars(doc): |
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
const fetch = require('node-fetch') | |
const { JSDOM } = require('jsdom') | |
const nodeEval = require('node-eval') | |
const xmlParser = require('fast-xml-parser') | |
const DEFAULT_LANG = 'ja' | |
function extractTracksFromHTML(body) { | |
const dom = new JSDOM(body) |
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/sh | |
set -eu | |
SELECT_SCHEMA_SQL=<<EOF | |
SELECT SCHEMA_NAME FROM information_schema.SCHEMATA | |
WHERE SCHEMA_NAME NOT IN ("information_schema", "performance_schema"); | |
EOF | |
mysql -u root -N -e "${SELECT_SCHEMA_SQL}" | while read dbname; do |
NewerOlder