Skip to content

Instantly share code, notes, and snippets.

View dlford's full-sized avatar

Dan Ford dlford

View GitHub Profile
@dlford
dlford / cloudflare_ddns.rsc
Last active September 18, 2023 14:41
MikroTik RouterOS Cloudflare DDNS with API Token
# Create a token with DNS edit and read permissions on all zones - https://dash.cloudflare.com/profile/api-tokens
# Get zoneid from https://dash.cloudflare.com/ => select a domain => Overview => API => Zone ID
# Get DNS record id:
# curl --request GET \
# --url https://api.cloudflare.com/client/v4/zones/{zoneid}/dns_records \
# --header 'Content-Type: application/json' \
# --header 'Authorization: Bearer {api_token}'
# --- config ---
@yairEO
yairEO / minifyHTML.js
Last active September 3, 2023 22:22
HTML string minify / compress to single-line
/**
* @param {string} s [HTML string]
*/
function minify( s ){
return s ? s
.replace(/\>[\r\n ]+\</g, "><") // Removes new lines and irrelevant spaces which might affect layout, and are better gone
.replace(/(<.*?>)|\s+/g, (m, $1) => $1 ? $1 : ' ')
.trim()
: ""
}
@luukvbaal
luukvbaal / cacheremove.hook
Last active June 23, 2024 15:17
yay paccache hooks
[Trigger]
Operation = Remove
Type = Package
Target = *
[Action]
Description = Clearing cache...
When = PostTransaction
Exec = /home/<user>/.local/bin/tools/removehook
@ayamflow
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016 19:10
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);