- Create Firebase Project
- Create "web" app within firebase to get config values"
- Install firebase in your project "npm i firebase
- Create a config file in your project
- Add authentication for email/password and Google
- Create a user from Firebase
- Enable Firestore
- Add rules for firestore
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
AWS SQS Queue Access Policy to Store data to S3 RAW VIDEOS: | |
{ | |
"Version": "2012-10-17", | |
"Id": "__default_policy_ID", | |
"Statement": [ | |
// existing data... add the statement below | |
{ | |
"Effect": "Allow", | |
"Principal": { |
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 APP = { | |
SW: null, | |
init() { | |
//called after DOMContentLoaded | |
if ('serviceWorker' in navigator) { | |
// 1. Register a service worker hosted at the root of the | |
// site using the default scope. | |
navigator.serviceWorker | |
.register('/sw.js', { | |
scope: '/', |
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
// SIGN UP | |
// const { mutate: signUp } = trpc.user.signup.useMutation({ | |
// onError: (e) => { | |
// console.log("Error===>", e); | |
// // showAlert(res?.message, 'error'); | |
// }, | |
// onSuccess: () => { | |
// console.log("success"); | |
// // showAlert('Corporate Admin successfully set', 'success'); |
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
You can use Axios interceptors to automatically append the bearer token from local storage to all outgoing requests. Here's how you can set it up: | |
```javascript | |
import axios from 'axios'; | |
// Create an instance of axios | |
const axiosInstance = axios.create(); | |
// Add a request interceptor | |
axiosInstance.interceptors.request.use( |
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
class PayeCalculator { | |
constructor(basicSalary, housingAllowance, transportAllowance, otherAllowance) { | |
this.basicSalary = basicSalary; | |
this.housingAllowance = housingAllowance; | |
this.transportAllowance = transportAllowance; | |
this.otherAllowance = otherAllowance; | |
} | |
calculatePension() { | |
const grossIncome = this.basicSalary + this.housingAllowance + this.transportAllowance + this.otherAllowance; |
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 { HttpException, HttpStatus, Logger } from "@nestjs/common"; | |
import axios from "./client"; | |
import { | |
handleErrorResponse, | |
handleSuccessResponse, | |
} from "@/utils/handleError"; | |
import { Wallet } from "@/modules/wallet/entity/wallet.entity"; | |
import { InjectRepository } from "@nestjs/typeorm"; | |
import { Repository } from "typeorm"; | |
import { UserInfo } from "@/modules/user/entity/user.entity"; |
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
{ | |
billResponse: { | |
status: '00', | |
message: 'Successfull', | |
wallet_balance: 14411.77, | |
order: 'GOtv Lite N1,400 to 8059920770. ', | |
ref: '231117928264', | |
response_hash: '9fff70a3d8ab1ba1b3464c2556645b54aa3098c1' | |
} | |
} |
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
CREATE TABLE accounts( | |
id serial PRIMARY KEY, | |
name VARCHAR(256) NOT NULL | |
); | |
CREATE TABLE entries( | |
id serial PRIMARY KEY, | |
description VARCHAR(1024) NOT NULL, | |
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0), | |
-- Every entry is a credit to one account... |
This sheet goes along with this SSH YouTube tutorial
$ ssh [email protected]
$ mkdir test
$ cd test
NewerOlder