This file contains 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
// コンタクトフォーム7 日本語判定 ここから | |
add_filter('wpcf7_validate_text', 'wpcf7_validate_hurigana', 11, 2); | |
add_filter('wpcf7_validate_text*', 'wpcf7_validate_hurigana', 11, 2); | |
function wpcf7_validate_hurigana($result,$tag){ | |
$tag = new WPCF7_Shortcode($tag); | |
$name = $tag->name; | |
$value = isset($_POST[$name]) ? trim(wp_unslash(strtr((string) $_POST[$name], "\n", " "))) : ""; | |
// 入力項目名が、'hurigana'の場合に実行 | |
if ( $name === "hurigana") { | |
// ひらがな・カタカナ以外だった場合 |
This file contains 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
version: "3" | |
services: | |
my_app: | |
container_name: my_app | |
image: my_app:latest | |
volumes: | |
- .:/app | |
working_dir: /app | |
networks: |
This file contains 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
FROM python:3.8-slim-buster | |
RUN apt upgrade && apt update && apt-get -y install gcc libmariadb-dev # <-- this is effective line! | |
WORKDIR /app | |
ENV LANG=ja_JP.utf8 | |
ENV LC_ALL=ja_JP.utf8 | |
ENV TZ="Asia/Tokyo" | |
COPY . . | |
RUN pip3 install -r requirements.txt | |
EXPOSE 80 | |
CMD [ "python", "main.py" ] |
This file contains 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 ffmpeg | |
import os | |
import logging | |
logger = logging.getLogger(__name__) | |
class MediaConverter: | |
@staticmethod | |
def to_flac(input_file_path)->str: | |
''' media file convert to flac | |
Args |
This file contains 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 urllib | |
import json | |
class Recaptcha(): | |
url = 'https://www.google.com/recaptcha/api/siteverify' | |
# Get secret an public key from https://www.google.com/recaptcha/admin/ | |
secret = 'YOUR_SECRET_KEY' | |
site_key = 'YOUR_SITE_KEY' |
This file contains 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 | |
import xmltodict | |
class YahooAPI: | |
_base_url = 'https://jlp.yahooapis.jp/FuriganaService/V1/furigana' | |
_client_id = '' | |
_secret_key = '' | |
kana_xml = None | |
kana_api_url = None | |
headers = None |