This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE need_to_update | |
INNER JOIN original ON need_to_update.id = original.id | |
SET need_to_update.field1 = original.field1, | |
need_to_update.field2 = original.field2, | |
need_to_update.field3 = original.field3, | |
... | |
WHERE condition(ex: original.updated_at like '2020-02-09%'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swapoff -a | |
sudo fallocate -l 15G /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
swapon -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'exifr/jpeg' | |
files = Dir['*.jpg', '*.jpeg'] | |
files.each do |f| | |
im = EXIFR::JPEG.new(f) | |
p im.copyright if im.copyright |