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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace jp.ptsv.library | |
{ | |
using OptionMap = Dictionary<string, string>; | |
using OptionList = List<string>; |
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
// jquery | |
import $ from 'jquery/dist/jquery.slim'; | |
// 静的アセット(画像、CSSファイルなど) | |
import 'bootstrap/dist/css/bootstrap.css'; | |
import './style.css'; | |
import 'trumbowyg/dist/ui/trumbowyg.css'; | |
// jQueryプラグイン関係のjsファイルは 末尾に ?url を付けてアセットとしてインポートさせ、 | |
// 後から動的にscriptタグで注入する。 |
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
<!doctype html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>サンプル</title> | |
<script type="module" src="/main.js"></script> | |
</head> | |
<body> | |
<div class="container my-3"> |
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
/******************************************************************** | |
// require ... | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
*********************************************************************/ | |
public static string[] Where(string CommandName) | |
{ |
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
const getType = o => Object.prototype.toString.call(o).match(/\w+/g)?.at(1); | |
export function plainObjectToFormData(o) | |
{ | |
const isPlainObject = o => 'Object' === getType(o); | |
if(!isPlainObject(o) || Object.keys(o).length > 0) | |
return; | |
const fd = new FormData; |
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
// use Cache API and cache expire 2 weeks | |
async function cachedFetchJson(uri,seconds) | |
{ | |
const expire = seconds || (14 * 24 * 3600); | |
const today = Math.ceil(new Date().getTime() / 1000); | |
const cache = await caches.open('v1'); | |
let response = await cache.match(uri); | |
if(!response || ((parseInt(response.headers.get('cache-timestamp') || -1) + expire <= today))) | |
{ |
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
@ECHO off | |
REM certbot wrapper | |
REM renew-sslcert [test] | |
REM testを指定すると、--dry-run (シミュレーション)を付けて実行します。 | |
SETLOCAL | |
if "%~1"=="test" ( | |
SET DRYRUN=--dry-run | |
) else ( | |
SET DRYRUN= | |
) |
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
@ECHO off | |
REM CERTBOT MANUAL CLEANUP AUTH HOOK | |
REM CERTBOTから下記環境変数がセットされてこのファイルが実行されますので、この情報を使ってFTPなどで認証ファイル削除します。 | |
REM CERTBOT_DOMAIN : The domain being authenticated | |
REM CERTBOT_VALIDATION : The validation string | |
REM CERTBOT_TOKEN : Resource name part of the HTTP-01 challenge (HTTP-01 only) | |
REM CERTBOT_REMAINING_CHALLENGES : Number of challenges remaining after the current challenge | |
REM CERTBOT_ALL_DOMAINS : A comma-separated list of all domains challenged for the current certificate |
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
@ECHO off | |
REM certbot wrapper | |
REM sslcert <ドメイン名> [test] | |
REM testを指定すると、--dry-run (シミュレーション)を付けて実行します。 | |
SETLOCAL | |
if "%~1"=="" ( | |
ECHO SSL証明書を取得するドメイン名を入力してください。 | |
GOTO END | |
) |
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 pdf2img from './pdf2img.js'; | |
(($) => { | |
// PDFファイル選択 | |
// -------------------------------------------------------------------------- | |
async function onChangeFile(ev) | |
{ | |
if(this.files.length <= 0) | |
return; |
NewerOlder