Skip to content

Instantly share code, notes, and snippets.

>>> def wrap(f):
...     # NOTE: self は args[0] に入る
...     def _wrap(*args, **kwargs):
...         print('Before')
...         res = f(*args, **kwargs)
...         print('After')
...         return res
...     return _wrap
... 
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""関数の中でグローバル変数を使えなくするデコレータ"""
from typing import List
from typing import Dict
from typing import Optional
from typing import Callable
from typing import Any
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""PDF にした Amazon の領収書から「注文日」「注文番号」「請求総額」を取り出すやつ
# 下準備
$ pip install pymupdf click
# 使い方
$ python amznreceipt.py -f <pdf-filepath>
@momijiame
momijiame / Vagrantfile
Created December 17, 2024 01:10
Vagrantfile for Hadoop (3.3) Cluster with Hive (4.0) and Spark (3.5)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define :master, primary: true do |master|
master.vm.box = "bento/rockylinux-9"