Skip to content

Instantly share code, notes, and snippets.

View pandanote-info's full-sized avatar

pandanote-info pandanote-info

View GitHub Profile
@pandanote-info
pandanote-info / exo2srt.py
Last active September 3, 2023 15:20
AviUtlのエキスポートファイルから字幕ファイル(srt)ファイルを作成するためのコード
#!/usr/bin/env python3
# coding: utf-8
#
# See https://pandanote.info/?p=29 for details.
#
import io
import sys
import re
import codecs
@pandanote-info
pandanote-info / ssl_multi_tenant_example.conf
Created June 19, 2017 21:25
Let's encryptから取得した異なるドメインに対するSSL/TLS証明書を同一のWebサーバで共存させて使用するための設定例
# 1つめのドメインの設定
<VirtualHost _default_:443>
ServerName example.org:443
SSLCertificateFile /etc/letsencrypt/live/example.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.org/privkey.pem
</VirtualHost>
# 2つめのドメインの設定
<VirtualHost _default_:443>
ServerName www.example.jp:443
@pandanote-info
pandanote-info / content.php.diff
Last active June 25, 2017 01:57
Iconic Oneテーマで各記事の最終更新日を表示するための修正用の差分コード。
--- content.php.ORG 2017-06-25 00:07:58.831052983 +0900
+++ content.php 2017-06-25 10:50:23.258825536 +0900
@@ -28,7 +28,12 @@
<span class="fn"><?php echo the_author_posts_link(); ?></span>
</span>
<span class="meta-sep">|</span>
- <span class="date updated"><?php echo get_the_date(); ?></span>
+ <span class="date updated"><?php echo get_the_date(); ?>
+ <?php if (get_the_modified_date('Y/n/j') != get_the_time('Y/n/j')) :
+ echo (wp_is_mobile())?", &#9200; : ":", Last update: ";
@pandanote-info
pandanote-info / lupin3rdtwexo.py
Last active August 29, 2018 13:51
AviUtlのエクスポートファイル版ルパン三世風タイトルパーツメーカー
#!/usr/bin/env python3
# coding: utf-8
# AviUtlのエクスポートファイル版ルパン三世風タイトルパーツメーカー
# Copyright 2017,2018 pandanote.info (https://pandanote.info/)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@pandanote-info
pandanote-info / EditPage.php.diff
Last active July 26, 2017 22:18
MediaWikiのPHP 7.0以降対応用のtemporary patch
--- EditPage.php.ORG 2017-07-26 23:37:33.446933850 +0900
+++ EditPage.php 2017-07-27 07:15:49.483444502 +0900
@@ -2594,7 +2594,9 @@
$previewOutput = $this->getPreviewText();
}
- Hooks::run( 'EditPage::showEditForm:initial', [ &$this, &$wgOut ] );
+ // Avoid PHP 7.1 warning of passing $this by reference
+ $editPage = $this;
+ Hooks::run( 'EditPage::showEditForm:initial', [ &$editPage, &$wgOut ] );
@pandanote-info
pandanote-info / MediaWiki_PHP_7_0.diff
Created July 29, 2017 04:34
MediaWikiのPHP 7.0以降対応用のtemporary patch
--- EditPage.php.ORG 2017-07-26 23:37:33.446933850 +0900
+++ EditPage.php 2017-07-27 07:15:49.483444502 +0900
@@ -2594,7 +2594,9 @@
$previewOutput = $this->getPreviewText();
}
- Hooks::run( 'EditPage::showEditForm:initial', [ &$this, &$wgOut ] );
+ // Avoid PHP 7.1 warning of passing $this by reference
+ $editPage = $this;
+ Hooks::run( 'EditPage::showEditForm:initial', [ &$editPage, &$wgOut ] );
@pandanote-info
pandanote-info / sesman.ini.f26.diff
Created July 29, 2017 14:34
TigerVNC 1.8.0以降のクリップボードサポートを無効にするためのpatch.
--- /etc/xrdp/sesman.ini.ORG 2017-07-29 12:13:38.416950361 +0900
+++ /etc/xrdp/sesman.ini 2017-07-29 12:14:46.772060425 +0900
@@ -69,6 +69,10 @@
param=-localhost
param=-dpi
param=96
+param=-AcceptCutText=0
+param=-SendCutText=0
+param=-SendPrimary=0
+param=-SetPrimary=0
@pandanote-info
pandanote-info / movielist.py
Last active November 23, 2018 08:42
Youtubeから動画のID等のリストを取り出すためのPython3のテストプログラム。
#!/usr/bin/python
import httplib2
import os
import sys
import argparse
from apiclient.discovery import build
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
@pandanote-info
pandanote-info / wordpress-ssl.conf
Last active September 20, 2017 13:52
HTTP/1.1以外のプロトコルでの接続を拒否する設定と、HTTPによるリクエストをHTTPSにリダイレクトする設定
<IfModule mod_rewrite.c>
RewriteEngine on
# HTTP/1.1以外のプロトコルでの接続を拒否する。
RewriteCond %{THE_REQUEST} HTTP/(1\.0|0\.[0-9])$
RewriteRule ^(.*)$ - [R=403,L]
# HTTPによるリクエストをHTTPSにリダイレクトする。
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>
@pandanote-info
pandanote-info / styles_thumbnails.css.php.diff
Last active September 5, 2017 13:03
YARPPをカスタマイズしてみた。
--- styles_thumbnails.css.php.ORG 2017-08-30 23:21:57.909532177 +0900
+++ styles_thumbnails.css.php 2017-08-31 07:34:47.572041369 +0900
@@ -8,7 +8,7 @@
$width = (isset($_GET['width'])) ? (int) $_GET['width'] : 120;
$margin = 5;
$width_with_margins = ($margin * 2) + $width;
-$height_with_text = $height + 50;
+$height_with_text = $height + 180;
$extra_margin = 7;