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
{ | |
"compilerOptions": { | |
/* Visit https://aka.ms/tsconfig to read more about this file */ | |
/* Projects */ | |
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ | |
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ | |
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ | |
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ | |
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ |
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 gaxios = require('gaxios'); | |
const { GoogleAuth, JWT, Impersonated, ImpersonatedOptions } = require('google-auth-library'); | |
const { Storage } = require('@google-cloud/storage'); | |
const { SecretManagerServiceClient } = require('@google-cloud/secret-manager'); | |
// node -e 'require("./main").demo()' | |
// tsc -d -p /home/srashid/Desktop/node_impersonated/google-auth-library-nodejs/tsconfig.json | |
// cp -R /home/srashid/Desktop/node_impersonated/google-auth-library-nodejs/build/src/* node_modules/google-auth-library/build/src/ |
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
[ | |
{ "code": "aa", "name": "Afar" }, | |
{ "code": "ab", "name": "Abkhazian" }, | |
{ "code": "ae", "name": "Avestan" }, | |
{ "code": "af", "name": "Afrikaans" }, | |
{ "code": "ak", "name": "Akan" }, | |
{ "code": "am", "name": "Amharic" }, | |
{ "code": "an", "name": "Aragonese" }, | |
{ "code": "ar", "name": "Arabic" }, | |
{ "code": "as", "name": "Assamese" }, |
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 { S3Client, GetObjectCommand } = require('@aws-sdk/client-s3'); | |
const client = new S3Client({}); | |
const streamToString = (stream) => new Promise((resolve, reject) => { | |
const chunks = []; | |
stream.on('data', (chunk) => chunks.push(chunk)); | |
stream.on('error', reject); | |
stream.on('end', () => resolve(Buffer.concat(chunks).toString('utf8'))); | |
}); |
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 AWS = require('aws-sdk') | |
AWS.config.update({ region: process.env.AWS_REGION }) | |
const s3 = new AWS.S3() | |
const uploadBucket = 'test-bucket-357' // Replace this value with your bucket name! | |
const URL_EXPIRATION_SECONDS = 30000 // Specify how long the pre-signed URL will be valid for | |
// Main Lambda entry point | |
exports.handler = async (event) => { | |
return await getUploadURL(event) | |
} |
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 Node.js 14 image. | |
# can't find one for 16 | |
# https://hub.docker.com/_/node | |
FROM node:18 | |
# Create and change to the app directory. | |
WORKDIR /usr/src/app | |
# Copy application dependency manifests to the container image. |
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
{ | |
"compilerOptions": { | |
"target": "ES2020", | |
"useDefineForClassFields": true, | |
"lib": ["ES2020", "DOM", "DOM.Iterable"], | |
"module": "ESNext", | |
"skipLibCheck": true, | |
/* Bundler mode */ | |
"moduleResolution": "bundler", |
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 { ReduxProvider } from "@/redux/provider"; | |
import Login from "./components/Login"; | |
export default function RootLayout() { | |
return ( | |
<html lang="en"> | |
<body> | |
<ReduxProvider> | |
<Login /> | |
</ReduxProvider> |
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
//redux/provider.js | |
"use client"; | |
import React from "react"; | |
import { Provider } from "react-redux"; | |
import store from "./index"; | |
export function ReduxProvider({ children }) { | |
return <Provider store={store}>{children}</Provider>; |
NewerOlder