Skip to content

Instantly share code, notes, and snippets.

@mann-ed
mann-ed / js
Created May 15, 2025 15:01
htmx-download
//I found this and updated it for my project
htmx.defineExtension('htmx-download', {
onEvent: function(name, evt) {
if (name == 'htmx:beforeSend') {
evt.detail.xhr.responseType = "arraybuffer";
evt.detail.xhr.setRequestHeader('Authorization', "Bearer " + getJWT());
}
if (name == 'htmx:beforeSwap') {
const status = evt.detail.xhr.status;
if (status == 200) {
@mann-ed
mann-ed / visualvm.sh
Created March 9, 2015 15:12
wrapper script to start visualvm for wildfly/jboss eap
#!/bin/sh
#VISUALVM="/data/software/java/visualvm/visualvm_138/bin/visualvm"
VISUALVM="/usr/java/jdk1.7.0_55/bin/jvisualvm"
JBOSS_HOME="/data/apps/jboss-eap-6.1/"
DIRNAME=`dirname "$0"`
# OS specific support (must be 'true' or 'false').
cygwin=false;
@mann-ed
mann-ed / gauge.js
Last active August 29, 2015 14:15 — forked from tomerd/gauge.js
function Gauge(placeholderName, configuration)
{
this.placeholderName = placeholderName;
var self = this; // for internal d3 functions
this.configure = function(configuration)
{
this.config = configuration;