Skip to content

Instantly share code, notes, and snippets.

View miklblitz's full-sized avatar
:octocat:
I may be slow to respond.

Михман miklblitz

:octocat:
I may be slow to respond.
  • Cl
  • Russia, Samara
View GitHub Profile
@miklblitz
miklblitz / download-file.js
Created May 17, 2020 20:33 — 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);
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%');
swapoff -a
sudo fallocate -l 15G /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
swapon -a
@miklblitz
miklblitz / exif.rb
Created September 12, 2017 06:03
package search copyright information into pictures
require 'exifr/jpeg'
files = Dir['*.jpg', '*.jpeg']
files.each do |f|
im = EXIFR::JPEG.new(f)
p im.copyright if im.copyright