Skip to content

Instantly share code, notes, and snippets.

View jbPellicciaImensi's full-sized avatar

Jean-Baptiste Pelliccia jbPellicciaImensi

View GitHub Profile
@jbPellicciaImensi
jbPellicciaImensi / download_file_discovery_explorer.mc2
Last active March 21, 2024 08:48
Here is a little tricks to implement a download button in the Discovery Explorer tool of Warp10.
// @endpoint https://sandbox.senx.io/api/v0/exec
// @preview discovery
// @theme dark
[ 'red' 'yellow' 'green' 'white' ] 'color' STORE
1 4 <%
'i' STORE
NEWGTS
1 30 <%
@jbPellicciaImensi
jbPellicciaImensi / download_file_discovery.html
Last active March 19, 2024 10:25
Here is a little tricks to implement a download button in the Discovery tool of Warp10.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>File Download Example</title>
<script>
function downloadJSON(jsonData) {
fileName = "data.json";
// Convert JSON object to a string and encode it to make it safe for URI.
const jsonString = encodeURIComponent(JSON.stringify(jsonData));