Skip to content

Instantly share code, notes, and snippets.

@nadar
nadar / remote.jsx
Last active November 24, 2021 13:49
remote.jsx
var flyo = {
fn: function() { alert("hoi") },
xml: "https://www.w3schools.com/xml/note.xml",
getData: function() {
var rawxml = app.doScript("do shell script \"curl 'remoteCode'\"".replace("remoteCode", this.xml), ScriptLanguage.APPLESCRIPT_LANGUAGE);
return new XML(rawxml);
}
}
@nadar
nadar / example.json
Created November 24, 2021 12:29
example.json
[
{"name":"John"},
{"name":"Jane"}
]
@nadar
nadar / date-to-strftime.md
Last active September 7, 2023 08:16
PHP 8.1 strftime to date

PHP 8.1 Migrate table from strftime to date

strftime date example
%d d 09
%m m 02
%Y Y 2022
%B F January
%b M Jan
%a D Son
@nadar
nadar / mailjet_sections_bulk_delete.php
Created September 12, 2022 08:23
Mailjet Sections Cleanup
<?php
$username = 'API_KEY';
$password = 'API_KEY_SECRET';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.mailjet.com/v3/REST/template?EditMode=3&OwnerType=apikey&limit=200');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, $username.':'.$password);
@nadar
nadar / cloudflare-block-wp.md
Last active April 23, 2025 06:54
Cloudflare WAF Block Wordpress Requests

The main purpose of this site is to block out requests which target on Wordpress Sites, BUT WE DONT USER WORDPRESS!

(http.request.uri contains "wp-login") or 
(http.request.uri contains "xmlrpc.php") or 
(http.request.uri contains "shell.php") or 
(http.request.uri contains "repeater.php") or 
(http.request.uri contains "wp-admin") or 
(http.request.uri contains "ccx") or 
(http.request.uri contains "wp-content") or