sora tob sakanaのイベント予定を通知するTwitter botです。
This file contains hidden or 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 requests | |
| from config import API_KEY | |
| CAL_ID = 'soratobsakanadesu@gmail.com' | |
| URL = f'https://www.googleapis.com/calendar/v3/calendars/{CAL_ID}/events' | |
| # 2019/11/01以降のイベントを取ってくる | |
| payload = { |
This file contains hidden or 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
| {% extends 'blog/base.html' %} | |
| {% block content %} | |
| <h2>New post</h2> | |
| <form method="POST" class="post-form">{% csrf_token %} | |
| <p> | |
| <label for="id_title"></label> | |
| {% if form.title.value is None %} |
[out:json];
area["name"~"中野区"];
(way(area)[highway!~"footway"][building!~"house|residential"];);
This file contains hidden or 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
| # ref. https://sanoto-nittc.hatenablog.com/entry/2017/12/16/213735 | |
| fpath=($(brew --prefix)/share/zsh/site-functions $fpath) | |
| # 補完機能有効化 | |
| autoload -U compinit | |
| compinit -u | |
| # 補完候補に色をつける | |
| autoload -U colors |
This file contains hidden or 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
| [20201128] | |
| レイライン | |
| Just Breathe | |
| ポケットにレベリー | |
| Pastureland | |
| 雨の栞 | |
| Lily | |
| am I | |
| Stain | |
| フィラメント |
This file contains hidden or 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
| counts = {} | |
| BYB = ( | |
| 'Lily', | |
| 'morning', | |
| 'am I', | |
| 'Any', | |
| 'HOLY GRAiL', | |
| 'ルーブルの空', | |
| 'Stain', | |
| 'Nostalgia', |
This file contains hidden or 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
| # 『Pythonでいかにして暗号を破るか』1章 練習問題 | |
| from typing import Any | |
| PLAIN_ALPHABET = [chr(i) for i in range(65, 91)] | |
| NUM_TO_ALPHABET = {idx: char for idx, char in enumerate(PLAIN_ALPHABET)} | |
| ALPHABET_TO_NUM = {char: idx for idx, char in enumerate(PLAIN_ALPHABET)} | |
| def encode_caeser(key: int, plain: str) -> str: | |
| plain_nums = [] |
This file contains hidden or 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
| # 『Pythonでいかにして暗号を破るか』5章 シーザー暗号 | |
| # caesarCipher.pyを参考にしたシーザー暗号プログラム | |
| class CaesarCipher: | |
| def __init__(self, key: int, symbols: str): | |
| self.key = key | |
| self.symbols = symbols | |
| def encrypt(self, message: str) -> str: |
This file contains hidden or 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
| # 『Pythonでいかにして暗号を破るか』6章 総当たり攻撃によるシーザー暗号の解読 | |
| def make_symbols() -> str: | |
| upper = '' | |
| a_ord = ord('A') | |
| for i in range(0, 26): | |
| upper += chr(a_ord+i) | |
| lower = upper.lower() | |
| symbols = upper + lower + '1234567890' + ' !?.' | |
| return symbols |