Skip to content

Instantly share code, notes, and snippets.

@t-cool
t-cool / php_form_submit.md
Last active February 21, 2022 11:54 — forked from jesperorb/php_form_submit.md
PHP form submitting with fetch + async/await

PHP Form submitting

アプリケーションに以下のような構造があるとします。

  • 📁 application_folder_name
    • 📄 index.php
    • 📄 handle_form.php
    • 📄 main.js

そして、フォームを備えた基本的なウェブサイトを動作させるために、index.php に以下の内容を記述します。これは、お好みのphpサーバーで実行できるはずです。

@t-cool
t-cool / idb-backup-and-restore.md
Created August 15, 2024 09:49 — forked from loilo/idb-backup-and-restore.js
Back up and restore an IndexedDB database

Back up and restore an IndexedDB database

This gist is an ES module which provides functions to import and export data from an IndexedDB database as JSON. It's based on Justin Emery's indexeddb-export-import package, but applies some adjustments that reflect better on the current browser landscape (i.e. better developer ergonomics but no support for Internet Explorer).

Usage

For each of the provided functionalities, you need a connected IDBDatabase instance.

Export Data

import { idb } from 'some-database'