Skip to content

Instantly share code, notes, and snippets.

View giovapanasiti's full-sized avatar
🎯
Focusing

Giovanni Panasiti giovapanasiti

🎯
Focusing
View GitHub Profile
@javilobo8
javilobo8 / download-file.js
Last active July 1, 2024 23:21
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);
@arjans
arjans / hash.rb
Last active December 28, 2017 06:59
Hash Table Implementation in Ruby
# Meant to work with strings as keys.
class MyHash
def initialize(size: 100)
@size = size
@hash = Array.new(size)
end
attr_accessor :hash
@sharshenov
sharshenov / .env.production
Created August 20, 2015 06:00
capistrano + foreman deploy for RubyOnRails
SECRET_KEY_BASE=ahsbdjhasbjhdabks # run rake:secret to generate
DATABASE_URL=postgres://user:pass@dbhost/database