Skip to content

Instantly share code, notes, and snippets.

View walosha's full-sized avatar
💭
Available for Hire

Olawale Afuye walosha

💭
Available for Hire
View GitHub Profile
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;
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(
// 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');
@walosha
walosha / app.js
Created January 28, 2025 06:37 — forked from prof3ssorSt3v3/app.js
Introduction to Service Workers code from video
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: '/',
@walosha
walosha / awsCopyPaste.txt
Created March 22, 2025 22:54 — forked from RivaanRanawat/awsCopyPaste.txt
All AWS Copy Paste material related to the video tutorial
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": {