Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View codeclinic's full-sized avatar

Phill Healey codeclinic

View GitHub Profile
@codeclinic
codeclinic / check_base64_encoding
Created August 2, 2019 13:27 — forked from palimadra/check_base64_encoding
A PHP file to check your website for base64 encoding on your website
<html><head><title>Find String</title></head><body>
<?php
// upload the file to the root and access the file via a browser.
//It may take time to run so be patient as it will check all the files in the root and the directories in the root
// Most hosting services will have a time limit on how long a php script can run, typically 30 seconds.
// On large sites with a lot of files this script may not be able to find and check all files within the time limit.
// If you get a time out error you can try over riding the default time limits by removing the // in the front of these two lines.
@codeclinic
codeclinic / gist:d432389e7d67f1a1fb73891feaa1d6fb
Created December 17, 2018 21:06
WordPress Admin Menu: External link with Icon
function add_custom_menu_item(){
add_menu_page( 'Menu Item Title', 'Page Title', 'manage_options', 'page_slug', 'function', 'dashicons-icon', 1 );
}
add_action( 'admin_menu', 'add_custom_menu_item' );
function custom_menu_item_redirect() {
$menu_redirect = isset($_GET['page']) ? $_GET['page'] : false;
if($menu_redirect == 'page_slug' ) {
@codeclinic
codeclinic / disable-rest-api-for-anonymous-users.php
Created July 4, 2018 08:19 — forked from khromov/disable-rest-api-for-anonymous-users.php
Disable WordPress REST API for anonymous users
<?php
/*
Plugin Name: Disable REST API for anonymous users
*/
/**
* Remove all endpoints except SAML / oEmbed for unauthenticated users
*/
add_filter( 'rest_authentication_errors', function($result) {
if ( ! empty( $result ) ) {
@codeclinic
codeclinic / slack_notification.php
Created October 3, 2016 13:41 — forked from alexstone/slack_notification.php
Fire a Slack Notification via CURL
<?php
// (string) $message - message to be passed to Slack
// (string) $room - room in which to write the message, too
// (string) $icon - You can set up custom emoji icons to use with each message
public static function slack($message, $room = "engineering", $icon = ":longbox:") {
$room = ($room) ? $room : "engineering";
$data = "payload=" . json_encode(array(
"channel" => "#{$room}",
"text" => $message,
@codeclinic
codeclinic / README.md
Last active September 4, 2015 15:38 — forked from blackjid/README.md
How configure your raspberry pi with dashing to have a awesome dashboard

Raspberry pi dashboard

This is what we did to setup a few dashboards at platanus

You'll need

  • Raspberry Pi
  • Dashing Service
  • Wifi stick (optional)