Skip to content

Instantly share code, notes, and snippets.

View Sathiyapramod's full-sized avatar
🎯
Focusing

Sathiyapramod Raghavendran Sathiyapramod

🎯
Focusing
View GitHub Profile
@Sathiyapramod
Sathiyapramod / tsconfig.basic.json
Created May 24, 2024 07:06
basic setup for the tsconfig.json
{
"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. */
@Sathiyapramod
Sathiyapramod / main.js
Created May 20, 2024 12:10 — forked from salrashid123/main.js
Impersonated Credentials for GCP node.js
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/
@Sathiyapramod
Sathiyapramod / ISO-639-1-language.json
Created May 16, 2024 17:25 — forked from jrnk/ISO-639-1-language.json
ISO 639-1 Alpha-2 codes of languages JSON
[
{ "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" },
@Sathiyapramod
Sathiyapramod / getObject.js
Created May 8, 2024 06:52 — forked from SalvoCozzubo/getObject.js
GetObject Example
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')));
});
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)
}
# 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.
@Sathiyapramod
Sathiyapramod / tsconfig.frontend.json
Created February 27, 2024 11:59
Front-end tsconfig.json
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
@Sathiyapramod
Sathiyapramod / layout.jsx
Created February 25, 2024 07:23
Profile Page
import { ReduxProvider } from "@/redux/provider";
import Login from "./components/Login";
export default function RootLayout() {
return (
<html lang="en">
<body>
<ReduxProvider>
<Login />
</ReduxProvider>
@Sathiyapramod
Sathiyapramod / provider.jsx
Created February 25, 2024 07:22
Provider Component
//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>;