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; |
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
/**************************************************************************** | |
* convert pdf to jpeg | |
* | |
* file: File instance (File object), | |
* type: output image format name (String: 'image/jpeg' or 'image/png' only) | |
* resolution: output resolution (INTEGER) | |
****************************************************************************/ | |
import './pdfjs/build/pdf.min.js'; | |
// おまじない。よくわからんけど、付けないとなんかエラー?がでるみたい。 |
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
/****************************************************************************** | |
Japan Marc Dat file | |
******************************************************************************/ | |
const MATERIALS = new Map([ | |
['a','図書'], | |
['c','楽譜'], | |
['e','地図資料'], | |
['g','映像資料'], |
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
/***************************************************************************** | |
* | |
* table to json | |
* | |
*****************************************************************************/ | |
(function() { | |
HTMLTableElement.prototype.toJSON = toJSON; | |
HTMLTableElement.prototype.toArray = toArray; | |
function toJSON(indent,fn,headers) |
NewerOlder