Skip to content

Instantly share code, notes, and snippets.

View vijayakumar-psg587's full-sized avatar

Vijayakumar vijayakumar-psg587

View GitHub Profile

Iterables, AsyncIterables, Observables, Oh My!

I know there is a lot of confusion around Observables, Iterables, AsyncIterables and AsyncObservables. Let's try to break this down and the reasons for each.

Pull versus Push Collections

When it comes to collections, you have two ways of thinking about collections, push versus pull. With pull, the consumer is in control of when you get the items, but with push, you get the values when the producer is ready.

Pull Based Collections

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at [email protected] or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

@vijayakumar-psg587
vijayakumar-psg587 / update-golang.md
Created September 9, 2021 07:13 — forked from nikhita/update-golang.md
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

Node parameters: --require ts-node/register -r ts-node -r dotenv/config -r tsconfig-paths/register src/main.ts dotenv_config_path=./config/development/.env
// baiscally we need -require ts-node/register <things in nodemon exec>
NODE_ENV=dev
{
"name": "@feedback/cloud-storage-app",
"description": "This is the default storage app used by feedback",
"version": "1.0.12",
"author": "VijayKumar <[email protected]>",
"keywords": [
"feedback-gcloud-storate",
"feedback-storage",
"feedback-cloud-storage"
],
export async function downloadEnvFiles(env_name): Promise<any> {
const LOGGER: pino.Logger = PinoLoggerServiceInstance.getLogger(__filename);
return new Promise(async (res, rej) => {
// Get the storage
const str = GcloudAuthenticationInstance.createGcloudAuthenticationBucket();
try {
// get the file list from the storage and the bucket
const [files] = await str.bucket(GCLOUD_ENV_STR_BUCKET_NAME).getFiles();
// filter the req file
export async function uploadEnvFiles(env_name: string) {
const LOGGER: pino.Logger = PinoLoggerServiceInstance.getLogger(__filename);
return new Promise(async (res, rej) => {
// Get the storage bucket
const str = GcloudAuthenticationInstance.createGcloudAuthenticationBucket();
// get the bucket name
const bucketToUpload = GCLOUD_ENV_STR_BUCKET_NAME;
let uploadLocalFilePath;
getGcloudAuthModel(): AuthenticationModel {
const authModel: GcloudAuthenticationModel = new GcloudAuthenticationModel();
authModel.autoRetry = true;
authModel.keyFilename = GCLOUD_KEY_FILE;
authModel.projectId = GCLOUD_PRJ_ID;
authModel.scope = GCLOUD_STROAGE_SCOPE;
authModel.maxRetries = GCLOUD_CONN_MAX_RETRIES;
return authModel;
}
import {Storage} from '@google-cloud/storage';
import { AuthenticationModel } from '../models/authentication.model';
import { AppUtilServiceInstance } from './app.util.service';
import * as pino from 'pino';
import { PinoLoggerServiceInstance } from './pino.logger.service';
export class GcloudAuthentication {
private gcloudAuthModel: AuthenticationModel;
private LOGGER: pino.Logger;
constructor() {
export interface AuthenticationModel {
keyFile?: string;
keyFilename?: string;
autoRetry?: boolean;
projectId?: string;
apiEndpoint?: string;
maxRetries?: number;
client_id?: string;
client_secret?: string;
scope?: string[];