Skip to content

Instantly share code, notes, and snippets.

View amane-katagiri's full-sized avatar

Amane Katagiri amane-katagiri

View GitHub Profile
@amane-katagiri
amane-katagiri / pdfpun.sh
Last active May 6, 2020 09:18
pdfpun互換
#!/bin/bash -ue
INFILE=$1
if [ $# -ge 2 ]; then
OUTFILE=$2
else
OUTFILE=nup-$1
fi
pdfjam $INFILE --a5paper --reflect true -o /dev/stdout | pdfjam /dev/stdin --nup 2x1 --a4paper --landscape --reflect true -o $OUTFILE
@amane-katagiri
amane-katagiri / activate.fish.patch
Last active February 19, 2020 00:59
Fix activate.fish of venv
--- old_venv/bin/activate.fish 2018-11-28 15:29:12.939054337 +0900
+++ new_venv/bin/activate.fish 2020-02-19 09:58:19.751090341 +0900
@@ -13,10 +13,12 @@ function deactivate -d "Exit virtualenv
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
functions -e fish_prompt
set -e _OLD_FISH_PROMPT_OVERRIDE
- functions -e fish_prompt
- set -e _OLD_FISH_PROMPT_OVERRIDE
- functions -c _old_fish_prompt fish_prompt
- functions -e _old_fish_prompt
@amane-katagiri
amane-katagiri / suiseiseki.txt
Created February 16, 2020 11:59 — forked from neon-izm/suiseiseki.txt
インターネットの海に漂っていたコピペをアーカイブしておきます。
あまりにも翠星石が好きすぎたから地域の家出少女の掲示板探して12万用意して釣った19歳無職女に1週間翠星石コス&口調マネさせて暮らさせた最終的に4日目で逃げられたけど……
翠星石としては駄目だったよ
そもそも衣装はLLで女のサイズはMでブカブカ
タバコ吸うし茶髪と金髪混じってるしリスカしてるし
マトモに演じられるタマではなかった
でも2日目あたりの「◯◯さん冷蔵庫のアイス食べていいんですぅ?」は今も心に残ってる
ていうか「逃げたかったら別に逃げてもいいよ」って言ってたし
@amane-katagiri
amane-katagiri / main.py
Created November 30, 2019 16:35
Write access log in JSON.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime
import json
import logging
import os
import uuid
@amane-katagiri
amane-katagiri / んわ笑ってる゜!ま、よや8ZZp.txt
Created October 2, 2019 07:37
んわ笑ってる゜!ま、よや8ZZp
んわ笑ってる゜!ま、よや8ZZp
@amane-katagiri
amane-katagiri / 31west2.py
Last active April 24, 2019 15:16
つくば市 ごみの出し方カレンダー 西地区 2019年度 2019.4〜2020.3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from datetime import date, timedelta
START, END = date(2019, 4, 1), date(2020, 4, 1)
BURNABLE_DAY = [date(2019, 12, 28)]
HOLIDAY = [date(2019, 12, 30), date(2019, 12, 31), date(2020, 1, 1), date(2020, 1, 2)]
def main(*args, **kwargs):
@amane-katagiri
amane-katagiri / extract-bookmark.sh
Last active April 24, 2019 07:22
Extract your jsonlz4 bookmark to json.
#!/bin/bash -Cue
lz4jsoncat $(ls $HOME/.mozilla/firefox/*.default/bookmarkbackups/*.jsonlz4 | tail -n1) > ${HOME}/.bookmarks.json
@amane-katagiri
amane-katagiri / ceek.sh
Last active February 4, 2019 00:17
news ceeker
#!/bin/bash -eu
FEED="http://news.ceek.jp/search.cgi"
OUTPUT_HTML="$1"
curl -Ss --retry 5 "$FEED" | \
xmllint --xpath "//table[3]//td[2]/table/tr[3]/td/table//td[1]//a" --html - 2>/dev/null | nkf -w | \
sed -e "s/<a/<li><a/g" | \
tr -d "\n" | tr -d "\t" | \
sed -e "s/ *</</g" | \
python3 -c "print('<!DOCTYPE html><html><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>CEEK.JP NEWS</title><style>li{{margin: 1em 0;}}</style></head><body><p><strong>$(date -Iseconds)</strong></p><ol>{}</ol></body></html>'.format(input()))" > $OUTPUT_HTML
@amane-katagiri
amane-katagiri / print_zj58
Last active November 17, 2018 10:40
ZJ-58で印刷(ImageMagickを必要)
#!/bin/bash -Cue
FONTSIZE='31'
PRINTER='ZJ-58'
if [ "$#" -lt 1 ]; then
echo "usage: $0 PRINT_TO_TEXT" 1>&2
exit 1
fi
if ! type convert 2>/dev/null 1>/dev/null || ! type identify 2>/dev/null 1>/dev/null; then
\documentclass[a4paper]{bxjsarticle}
\geometry{left=5truemm,top=5truemm,right=5truemm,bottom=5truemm}
\usepackage{luatexja}
\usepackage[sourcehan]{luatexja-preset}
\usepackage{luatexja-otf}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric,positioning,arrows.meta}
\newcommand{\nodesize}{0.25\textwidth}
\newcommand{\nodecolor}{gray}