Skip to content

Instantly share code, notes, and snippets.

View yudatadei's full-sized avatar

Yudatadei yudatadei

  • Dar es salaam - Tanzania
View GitHub Profile
@yudatadei
yudatadei / AddCookiesInterceptor.java
Created April 25, 2022 03:10 — forked from nikhiljha/AddCookiesInterceptor.java
Retrofit2/OkHttp3 Cookies (Drag and Drop, One Size Fits 99%)
// Original written by tsuharesu
// Adapted to create a "drop it in and watch it work" approach by Nikhil Jha.
// Just add your package statement and drop it in the folder with all your other classes.
import android.content.Context;
import android.preference.PreferenceManager;
import android.util.Log;
import java.io.IOException;
import java.util.HashSet;
import csv
from django.core.management import BaseCommand
from django.utils import timezone
from products.models import ProductCategory, Product
class Command(BaseCommand):
help = "Loads products and product categories from CSV file."
@yudatadei
yudatadei / axios error
Created November 24, 2021 15:56
axios error interceptor
const api = axios.create({baseURL: 'https://api.backend.com'})
api.interceptors.response.use(
response => response,
error => {
if (error.response.data.message) {
error.message = error.response.data.message
}
return Promise.reject(error)
},
)

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database