Skip to content

Instantly share code, notes, and snippets.

View augustine-tran's full-sized avatar

Khanh Tran augustine-tran

  • Ho Chi Minh, Vietnam
  • 17:13 (UTC +07:00)
View GitHub Profile
@augustine-tran
augustine-tran / download-file.js
Created August 11, 2018 08:27 — 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);
@augustine-tran
augustine-tran / 01_extract_crt.rb
Created January 19, 2019 04:39 — forked from miry/01_extract_crt.rb
Extract certificate from the kubernetes config.
require 'optparse'
require 'yaml'
require 'base64'
options = {
config_path: File.join(ENV['HOME'], '.kube', 'config'),
write_dir: File.join(ENV['HOME'], '.kube')
}
OptionParser.new do |opts|