Skip to content

Instantly share code, notes, and snippets.

View oxlb's full-sized avatar
🎯
Focusing

Onexlab (Munish Kapoor) oxlb

🎯
Focusing
View GitHub Profile
@oxlb
oxlb / docker-compose.yml
Created August 6, 2020 13:54
Docker Compose MariaDB
version: '3.1'
services:
db:
image: mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: mydb
@oxlb
oxlb / docker_postgres_init.sql
Created September 5, 2020 16:07
Docker Postgress Seeding
CREATE TABLE student
(
id bigint NOT NULL,
name text COLLATE pg_catalog."default",
CONSTRAINT student_pkey PRIMARY KEY (id)
);
INSERT INTO student(id, name) VALUES
(1, 'A'),
(2, 'B'),
@oxlb
oxlb / .env
Created September 13, 2020 14:30
cognito
AWS_COGNITO_USER_POOL_ID=ap-southeast-1_OYnSpz7Zo
AWS_COGNITO_CLIENT_ID=21uj81kemk1of3usp9gm3alcq5
AWS_COGNITO_REGION=ap-southeast-1
AWS_COGNITO_IDENTITY_POOL_ID=ap-southeast-1:73057fab-16a2-4e42-b2f0-ce6f56928db1
const AWS = require('aws-sdk');
const jwt_decode = require('jwt-decode');
const AmazonCognitoIdentity = require('amazon-cognito-identity-js');
let cognitoAttributeList = [];
const poolData = {
UserPoolId : process.env.AWS_COGNITO_USER_POOL_ID,
ClientId : process.env.AWS_COGNITO_CLIENT_ID
};
@oxlb
oxlb / index.js
Created September 13, 2020 15:07
const AwsConfig = require('./../lib/AwsConfig');
function signUp(email, password, agent = 'none') {
return new Promise((resolve) => {
AwsConfig.initAWS ();
AwsConfig.setCognitoAttributeList(email,agent);
AwsConfig.getUserPool().signUp(email, password, AwsConfig.getCognitoAttributeList(), null, function(err, result){
if (err) {
return resolve({ statusCode: 422, response: err });
}
const response = {
@oxlb
oxlb / index.js
Created September 13, 2020 15:09
'use strict';
global.fetch = require('node-fetch')
require('dotenv').config();
const Cognito = require('./cognito/index');
const { verify } = require('./cognito/index');
const body = {
email: "[email protected]",
password: "Test123456!"
};
@oxlb
oxlb / go.mod
Last active October 7, 2020 13:38
go mod file
module github.com/oxlb/GoLangPostgresHelloWorld
go 1.14
@oxlb
oxlb / docker-compose.yml
Created October 8, 2020 22:46
go lang postgres
version: '3.6'
services:
postgres:
image: postgres
restart: always
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
- POSTGRES_DB=root
@oxlb
oxlb / docker_postgres_init.sql
Created October 8, 2020 22:48
golang students
CREATE TABLE students
(
id bigint NOT NULL,
name text COLLATE pg_catalog."default",
CONSTRAINT student_pkey PRIMARY KEY (id)
);
INSERT INTO students(id, name) VALUES
(1, 'A'),
package config
import "fmt"
const (
DBUser = "root"
DBPassword = "root"
DBName = "root"
DBHost = "0.0.0.0"
DBPort = "5432"