Skip to content

Instantly share code, notes, and snippets.

Avatar

Phill Healey codeclinic

View GitHub Profile
@codeclinic
codeclinic / check_base64_encoding
Created Aug 2, 2019 — forked from palimadra/check_base64_encoding
A PHP file to check your website for base64 encoding on your website
View check_base64_encoding
<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 Dec 17, 2018
WordPress Admin Menu: External link with Icon
View gist:d432389e7d67f1a1fb73891feaa1d6fb
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' ) {
View disable-rest-api-for-anonymous-users.php
<?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 Oct 3, 2016 — forked from alexstone/slack_notification.php
Fire a Slack Notification via CURL
View slack_notification.php
<?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 Sep 4, 2015 — forked from blackjid/README.md
How configure your raspberry pi with dashing to have a awesome dashboard
View README.md

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)
You can’t perform that action at this time.