Skip to content

Instantly share code, notes, and snippets.

Avatar

Kouji Nakashima kuc-arc-f

View GitHub Profile
@kuc-arc-f
kuc-arc-f / .env
Last active Aug 12, 2022
Next.js 12 で、Basic認証
View .env
NEXT_PUBLIC_USER=hoge
NEXT_PUBLIC_PASS=fuga
@kuc-arc-f
kuc-arc-f / PaginateBox.vue
Last active Jun 4, 2022
Vue 2 typescript + laravel 9, paginate sample
View PaginateBox.vue
<template>
<div class="">
<!--
<h3>PaginateChild</h3>
-->
<nav class="my-2">
<ul class="pagination">
<li class="page-item">
<a @click="first" class="page-link" href="#">&laquo;</a>
</li>
@kuc-arc-f
kuc-arc-f / .dockerignore
Last active May 29, 2022
aws ECR sample, コンテナファイルなど
View .dockerignore
node_modules
npm-debug.log
@kuc-arc-f
kuc-arc-f / Login.tsx
Last active May 9, 2022
firebase google Login
View Login.tsx
import React from 'react';
import { useEffect } from 'react';
import {auth} from '../../firebase';
import { onAuthStateChanged } from "firebase/auth";
//import { getAuth, signInWithRedirect } from "firebase/auth";
import { signInWithRedirect } from "firebase/auth";
import { getRedirectResult, GoogleAuthProvider } from "firebase/auth";
import { signOut } from 'firebase/auth'
@kuc-arc-f
kuc-arc-f / package.json
Created Mar 29, 2022
exceljs , load data sample react
View package.json
{
"name": "react_ts",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
@kuc-arc-f
kuc-arc-f / apiGateway.ts
Created Jan 21, 2022
Serverless Framework + TypeScript, CORS sample
View apiGateway.ts
import type { APIGatewayProxyEvent, APIGatewayProxyResult, Handler } from "aws-lambda"
import type { FromSchema } from "json-schema-to-ts";
type ValidatedAPIGatewayProxyEvent<S> = Omit<APIGatewayProxyEvent, 'body'> & { body: FromSchema<S> }
export type ValidatedEventAPIGatewayProxyEvent<S> = Handler<ValidatedAPIGatewayProxyEvent<S>, APIGatewayProxyResult>
export const formatJSONResponse = (response: Record<string, unknown>) => {
return {
statusCode: 200,
headers: {
@kuc-arc-f
kuc-arc-f / graphql.js
Created Jan 18, 2022
Serverless Framework, apollo-server sample
View graphql.js
const { ApolloServer, gql } = require('apollo-server-lambda');
// typeDefs
const typeDefs = gql`
type Query {
hello: String
}
`;
const resolvers = {
@kuc-arc-f
kuc-arc-f / app.js
Created Jan 18, 2022
Serverless Framework express, prisma (mysql) sample
View app.js
const serverless = require('serverless-http');
const express = require('express');
const indexRouter = require('./routes/index');
const usersRouter = require('./routes/users');
const app = express();
app.use('/', indexRouter);
app.use('/users',usersRouter);
module.exports = app;
@kuc-arc-f
kuc-arc-f / LibMongo.js
Last active Jan 16, 2022
Serverless Framework + express, mongoDB atlas sample
View LibMongo.js
'use strict';
const MongoClient = require('mongodb').MongoClient;
const Config = require('../config.js');
const CFG = Config.getConfig();
//console.log( CFG.MONGODB_URL );
//console.log( CFG.MONGODB_DB_NAME );
const URI = CFG.MONGODB_URL + "?retryWrites=true&w=majority";
const DbName = CFG.MONGODB_DB_NAME;
module.exports.getClient = async () => {
// console.log("IS_OFFLINE= ", process.env.IS_OFFLINE);
@kuc-arc-f
kuc-arc-f / app.js
Created Jan 16, 2022
Serverless Framework + express, deploy sample
View app.js
const serverless = require('serverless-http');
const express = require('express');
const indexRouter = require('./routes/index');
const usersRouter = require('./routes/users');
const app = express();
app.use('/', indexRouter);
app.use('/users',usersRouter);
//module.exports = app;