Skip to content

Instantly share code, notes, and snippets.

/*
LiquidCrystal Library - Custom Characters
Demonstrates how to add custom characters on an LCD display.
The LiquidCrystal library works with all LCD displays that are
compatible with the Hitachi HD44780 driver. There are many of
them out there, and you can usually tell them by the 16-pin interface.
This sketch prints "I <heart> Arduino!" and a little dancing man
to the LCD.
@kdzwinel
kdzwinel / reloadCSS.js
Last active February 13, 2020 11:18
Reload CSS files without reloading the page
function reloadCSS() {
const links = document.getElementsByTagName('link');
Array.from(links)
.filter(link => link.rel.toLowerCase() === 'stylesheet' && link.href)
.forEach(link => {
const url = new URL(link.href, location.href);
url.searchParams.set('forceReload', Date.now());
link.href = url.href;
});
@zackdever
zackdever / html2csv.js
Created April 26, 2013 03:09
converts an html table to a csv string, and makes it available as a file download
function convertTableToCsv(tableSelector) {
return _.map($(tableSelector + ' tr'), function(row) {
return _.map($(row).find('th, td'), function(datum) {
return datum.textContent.replace(/,/g, '');
}).join(',');
}).join('\n');
}
// to download
var data = convertTableToCsv('#mytable');