Skip to content

Instantly share code, notes, and snippets.

View Exilz's full-sized avatar
🙃

Maxime Bertonnier Exilz

🙃
View GitHub Profile
@Exilz
Exilz / axios-interceptors-refresh-token.js
Created January 13, 2020 22:44 — forked from ModPhoenix/axios-interceptors-refresh-token.js
Axios interceptors token refresh for few async requests. ES6
import axios from 'axios';
import { settings } from '../settings';
import { authAPI } from '.';
const request = axios.create({
baseURL: settings.api_v1,
});
request.interceptors.request.use(
config => {
@Exilz
Exilz / commandes.js
Last active March 11, 2018 17:27
Commandes mongo cours MIW
// Commandes à réaliser dans un shell mongoDB, idéalement Intellishell de studio3T pour plus de clarté.
// Création de la collection
db.createCollection('movies');
// Insertions, fonctionnement du champ _id
db.articles.insert({ title: "Nom de l'article" }); // <- vérification de l'ajout + notes sur "_id"
db.articles.insert({ title: "Nom de l'article", subtitle: "Sous-titre" }); // notes sur les structures flexibles de mongo
db.articles.insert({ _id: "article-1", title: "Nom de l'article", subtitle: "Sous-titre" }); // <- necessité du champ _id
db.articles.insertMany([{ _id: "article-2", title: "Article 2" }, { "_id": "article-3", title: "Article 3" }]); // insertions multiples
/* Copyright 2015-2017 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@Exilz
Exilz / meteor_cordova_loader.js
Created November 2, 2015 15:20
Meteor Cordova loader with cold start
/* This file is only loaded on Cordova-bundled apps and is used only in case
* autoupdate package is used.
* It checks if File plugin is installed and a newer version of the app code can
* be found on persistent storage. In that case those files are dynamically
* added to the page.
* Otherwise a normal app code is loaded (shipped with the app initially).
*/
// Store the potential used URL on cold-start
var invokeURL;