Skip to content

Instantly share code, notes, and snippets.

View 02_modal_0.html
<!doctype html>
<!-- tailwindcss / modal -->
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="/css/tailwind.css" rel="stylesheet">
</head>
<body class="bg-gray-100">
<div class="container mx-auto px-8 pb-20">
@kuc-arc-f
kuc-arc-f / 02_navi.html
Created May 5, 2021
tailwindcss / nav サブメニューなし
View 02_navi.html
<!doctype html>
<!-- tailwindcss / nav サブメニューなし -->
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="/css/tailwind.css" rel="stylesheet">
</head>
<body class="bg-gray-100">
<div class="container mx-auto px-4 py-0">
@kuc-arc-f
kuc-arc-f / index.js
Created Apr 26, 2021
WP post , custom field data display
View index.js
import React from 'react'
import Head from 'next/head';
import Layout from '../components/layout'
import TopHeadBox from '../components/TopHeadBox'
import PagingBox from '../components/PagingBox'
import LibCommon from '../libs/LibCommon'
import LibPagenate from '../libs/LibPagenate'
import LibCms from '../libs/LibCms'
import IndexRow from './IndexRow';
@kuc-arc-f
kuc-arc-f / file_upload.js
Last active Apr 25, 2021
image upload, save Webp format
View file_upload.js
// next.js image upload, save Webp format
// pages/api/file_upload.js
import multer from 'multer';
import initMiddleware from '../../libs/init-middleware';
const fs = require('fs');
const path = require('path');
const sharp = require('sharp');
const upload = multer({
@kuc-arc-f
kuc-arc-f / mail.js
Last active Apr 23, 2021
next.js / mail send_sample
View mail.js
import React from 'react'
import LibCommon from '../libs/LibCommon'
import LibPagenate from '../libs/LibPagenate'
import LibTest from '../libs/LibTest'
import Layout from '../components/layout'
import LibConst from '../libs/LibConst'
//
export default class extends React.Component {
static async getInitialProps(ctx) {
@kuc-arc-f
kuc-arc-f / test4_async_pub.js
Created Apr 22, 2021
mail send, by nodemailer
View test4_async_pub.js
"use strict";
const nodemailer = require("nodemailer");
var receiverEmailAddress = 'to123@hoge.com'
var senderEmailAddress = 'from123@hoge.com'
async function smtp_send() {
let transporter = nodemailer.createTransport({
host: "smtp.hoge.com",
@kuc-arc-f
kuc-arc-f / docker-compose.yml
Created Apr 19, 2021
docker-compose.yml, wordpress
View docker-compose.yml
version: '3'
services:
db:
image: mysql:5.7
volumes:
- ./db/mysql_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
@kuc-arc-f
kuc-arc-f / posts.php
Last active Apr 17, 2021
wp posts data API
View posts.php
<?php
// required : wordpress 5.7.1
// wp posts data API
// /api/posts.php
require( '../wp-blog-header.php' );
$posts = wp_get_recent_posts(array( 'numberposts' => 1000 , 'post_status' => 'publish,private' ) );
//var_dump($posts);
echo json_encode($posts);
@kuc-arc-f
kuc-arc-f / schema.prisma
Created Apr 3, 2021
prisma / mysql schema file
View schema.prisma
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
@kuc-arc-f
kuc-arc-f / LibHeadless.js
Created Mar 13, 2021
Github clone数を取得する API
View LibHeadless.js
export default {
add_count: async function(items){
try{
var len = items.length
for(var i=0; i < len; i++){
var item = items[i]
//console.log(item)
var data = {
repo_id: item.id, name: item.name,