Skip to content

Instantly share code, notes, and snippets.

@arc279
arc279 / tree.py
Last active February 24, 2021 09:57
import anytree
from anytree.dotexport import RenderTreeGraph
class Foo(anytree.Node):
def __init__(self, name):
super().__init__(name)
def __gt__(self, other):
other.parent = self
return other
@arc279
arc279 / test_freezetime.py
Created November 19, 2020 05:40
pytest using freezegun
import pytest
import freezegun
import datetime
@pytest.fixture
def date1():
return datetime.datetime.now()
@pytest.fixture
@freezegun.freeze_time("2017-01-02")
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arc279
arc279 / closest-colors.ipynb
Last active August 20, 2020 09:28
RGBを近傍検索してそれっぽい色名を探す
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arc279
arc279 / dominant-colors-KMeans.ipynb
Created July 13, 2020 09:24
k平均法でドミナントカラーを調べる
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arc279
arc279 / nearest-colors-hsv.ipynb
Created July 9, 2020 05:07
HSV色空間に変換して近傍検索
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Section "InputClass"
Identifier "ELECOM TrackBall Mouse DEFT Pro TrackBall Mouse"
Driver "libinput"
MatchIsPointer "on"
Option "ButtonMapping" "1 2 3 4 5 6 7 8 9 1 11 12"
Option "ScrollMethod" "button"
Option "ScrollButton" "12"
EndSection
@arc279
arc279 / Makefile
Last active December 24, 2019 07:15
awscli で elasticache の arn が引けないので手で作るやつ
###
# make elasticache arn
###
export AWS_REGION := ap-northeast-1
# ex) arn:aws:elasticache:us-west-2:1234567890:cluster:my-cluster
.PHONY: arn
arn: fetch
@ cat c.json \
[{"name":"c0","type":"string"},{"name":"c1","type":"string"},{"name":"c2","type":"string"}]