Skip to content

Instantly share code, notes, and snippets.

View Tofandel's full-sized avatar

Adrien Foulon Tofandel

View GitHub Profile
@Tofandel
Tofandel / cloudflare.php
Created June 9, 2021 16:50
Synology cloudflare DDNS script
#!/usr/bin/php -d open_basedir=/usr/syno/bin/ddns
<?php
if ($argc !== 5) {
echo 'badparam';
exit();
}
$cf = new updateCFDDNS($argv);
$cf->makeUpdateDNS();
@Tofandel
Tofandel / nginx_substitute.conf
Created March 26, 2020 12:51
Nginx config to add any html to any proxied server
DocumentRoot /your/document/root
ProxyRequests off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:6000/ retry=0
ProxyPassReverse / http://127.0.0.1:6000/
<Location "/">
AddOutputFilterByType SUBSTITUTE text/html
Substitute 's|</head>|<script src="my-customjs.js"></script></head>|i'
</Location>
@Tofandel
Tofandel / elementor-tabs.js
Last active February 6, 2020 10:30
A nice hack to open elementor tabs with a get parameter, also pushes the parameter in history when the tab is clicked
jQuery(document).ready(function ($) {
try {
var url = new URL(document.location.href),
tab = parseInt(url.searchParams.get('tab'));
if (tab) {
var $title = $('#elementor-tab-title-' + tab),
$content = $('#elementor-tab-content-' + tab),
tabIndex = $title.data('tab');