Skip to content

Instantly share code, notes, and snippets.

View millipedia's full-sized avatar

millipedia millipedia

View GitHub Profile
@kongondo
kongondo / UpdateProcessWireFrontendContentUsingHtmxDemo.js
Last active August 11, 2023 11:47
Using htmx to Refresh ProcessWire Frontend Content
const UpdateProcessWireFrontendContentUsingHtmxDemo = {
initHTMXXRequestedWithXMLHttpRequest: function () {
document.body.addEventListener("htmx:configRequest", (event) => {
// @note: ADD THIS!!! if not using hx-include='token input'
// const csrf_token = UpdateProcessWireFrontendContentUsingHtmxDemo.getCSRFToken()
// event.detail.headers[csrf_token.name] = csrf_token.value
// add XMLHttpRequest to header to work with $config->ajax
event.detail.headers["X-Requested-With"] = "XMLHttpRequest"
})
},
@dknell
dknell / generate-app-icons.sh
Last active February 22, 2017 10:46
This script will generate all iOS and Android icon files (including retina) using the built-in sips command in OS X. It will also compress the PNGs if ImageOptim is installed. This is based off another awesome Gist found here: https://gist.github.com/jessedc/837916
#!/bin/bash
COMPRESS=1 # Compress if ImageOptim is intalled. 0 = disabled; 1 = enabled
iOSSubdir="/iOS" # make this an empty string to save in same dir
androidSubdir="/Android" # make this an empty string to save in same dir
help() {
echo ""
echo "Usage: ./$(basename "$0") <your_1024x1024.png>"
echo " --------------------------------------------------------------------------------------"