Skip to content

Instantly share code, notes, and snippets.

@NaoY-2501
NaoY-2501 / gcal_api_test.py
Last active November 12, 2019 15:38
Google Caledar APIを使ってみるテスト
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 = {

オサカナスケジュールbot

オサカナスケジュールbot is 何

sora tob sakanaのイベント予定を通知するTwitter botです。

@osakanaSchedule

作ってる人

@NaoY-2501
NaoY-2501 / post_edit.html
Last active March 8, 2020 15:27
Django Girls Tutorial with Vue.js
{% 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 %}
@NaoY-2501
NaoY-2501 / overpass_query.md
Last active September 11, 2020 15:08
overpass Queries

overpass-turbo

https://overpass-turbo.eu/#

道を抽出するクエリ(wip)

[out:json];
area["name"~"中野区"];
(way(area)[highway!~"footway"][building!~"house|residential"];);
@NaoY-2501
NaoY-2501 / .zshrc
Created September 15, 2020 07:19
My .zshrc
# 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
@NaoY-2501
NaoY-2501 / ysm_20200105-20201128.txt
Created December 27, 2020 07:00
2020年ヤナミューセトリ
[20201128]
レイライン
Just Breathe
ポケットにレベリー
Pastureland
雨の栞
Lily
am I
Stain
フィラメント
@NaoY-2501
NaoY-2501 / ysm_count.py
Created December 27, 2020 07:01
2020年ヤナミューセトリ集計スクリプト
counts = {}
BYB = (
'Lily',
'morning',
'am I',
'Any',
'HOLY GRAiL',
'ルーブルの空',
'Stain',
'Nostalgia',
@NaoY-2501
NaoY-2501 / cracking_codes_chpt1_practice.py
Last active January 23, 2021 08:03
『Pythonでいかにして暗号を破るか』1章 練習問題 回答
# 『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 = []
@NaoY-2501
NaoY-2501 / cracking_codes_chpt5_practice.py
Last active January 23, 2021 09:12
『Pythonでいかにして暗号を破るか』5章 アレンジ+練習問題回答
# 『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:
@NaoY-2501
NaoY-2501 / cracking_codes_chpt6_practice.py
Created January 23, 2021 09:12
『Pythonでいかにして暗号を破るか』6章 練習問題 回答
# 『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