Skip to content

Instantly share code, notes, and snippets.

View fgblomqvist's full-sized avatar

Fredrik Blomqvist fgblomqvist

View GitHub Profile
@paulsturgess
paulsturgess / service.js
Last active February 2, 2024 17:24
An example Service class wrapper for Axios
import axios from 'axios';
class Service {
constructor() {
let service = axios.create({
headers: {csrf: 'token'}
});
service.interceptors.response.use(this.handleSuccess, this.handleError);
this.service = service;
}
@mattbrictson
mattbrictson / application.html.erb
Last active August 16, 2023 15:33
Simpler nested layouts in Rails using the parent_layout helper
<%= render("shared/navbar") %>
<div class="container">
<%= render("shared/alerts") %>
<%= render("shared/page_header") %>
<%= yield %>
<%= render("shared/footer") %>