Skip to content

Instantly share code, notes, and snippets.

View CITGuru's full-sized avatar
🏠
Working from home

Oyetoke Tobiloba CITGuru

🏠
Working from home
View GitHub Profile
@CITGuru
CITGuru / axiosInterceptor.js
Created May 7, 2020 13:55 — forked from nzvtrk/axiosInterceptor.js
Axios create/recreate cookie session in node.js enviroment
/* Basic example of save cookie using axios in node.js and recreate session if it expired.
* Get/save cookie manually cause WithCredential axios param use XHR and not work in node.js
* Supports parallel request and send only one create session request.
* */
const BASE_URL = "https://google.com";
// Init instance of axios which works with BASE_URL
const axiosInstance = axios.create({ baseURL: BASE_URL });
@CITGuru
CITGuru / django_multiforms_view.py
Created May 28, 2018 04:19 — forked from imomaliev/django_multiforms_view.py
Django multiple forms CBV
# coding: utf-8
from __future__ import unicode_literals, absolute_import
from django.http.response import HttpResponseForbidden, HttpResponseRedirect
from django.views.generic.base import TemplateResponseMixin, ContextMixin
from django.views.generic.edit import ProcessFormView
class MultiFormMixin(ContextMixin):
from django.views.generic.base import View, TemplateResponseMixin
from django.views.generic.edit import FormMixin, ProcessFormView
class MultipleFormsMixin(FormMixin):
"""
A mixin that provides a way to show and handle several forms in a
request.
"""
form_classes = {} # set the form classes as a mapping