Skip to content

Instantly share code, notes, and snippets.

View farhantahir's full-sized avatar
🎯
Focusing

Farhan Tahir farhantahir

🎯
Focusing
  • Pakistan
View GitHub Profile
@farhantahir
farhantahir / download-file.js
Created March 19, 2019 10:18 — 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);
@farhantahir
farhantahir / install_node_ubuntu.md
Last active March 22, 2017 08:46
Install Node using NVM in Ubuntu