Skip to content

Instantly share code, notes, and snippets.

@sainu
sainu / download-file.js
Created March 19, 2018 19:41 — forked from javilobo8/download-file.js
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@sainu
sainu / .vimrc
Created March 23, 2018 15:05
vimrc for server os
set fenc=utf-8
set nobackup
set noswapfile
set autoread
set hidden
set showcmd
set number
set smartindent
set showmatch
set laststatus=2