Skip to content

Instantly share code, notes, and snippets.

View greghesp's full-sized avatar
🖐️

Greg Hesp greghesp

🖐️
View GitHub Profile
@javilobo8
javilobo8 / download-file.js
Last active October 27, 2024 09:15
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);
@kmdm
kmdm / esphome_ble_config.yaml
Last active June 26, 2024 17:13
esphome, esp32 ble tracker and Home Assistant mqtt_room sensors
# MQTT broker configuration
mqtt:
broker: !secret mqtt_broker
username: !secret mqtt_username
password: !secret mqtt_password
discovery: False # Only if you use the HA API usually
id: mqtt_client
# Define the room for this ESP32 node
substitutions:
@greghesp
greghesp / tailwind-flex-wrap-row-space.html
Last active December 24, 2022 19:36
Tailwind Flex Wrap with Row spacing
// Apply negative value to the items you want to add to each child
// In this example, the first row and last items to the right will have the overlap the negative values to create the effect of them not being there
<div class="flex flex-wrap -mt-2 -mr-2">
// forEach, map etc
// Apply a positive value to the items you want to add to each child.
<div class="mt-2 mr-2">Loop Item</div>
</div>