Skip to content

Instantly share code, notes, and snippets.

@dgallegos
dgallegos / functions.php
Last active July 18, 2020 07:45
WordPress Scan Failed - Non-HttpOnly Session Cookies
// Fix Trustwave Scan
// Non-HttpOnly Session Cookies Identified
// When you load the site you will see the security cookie twice, but the scan still passes.
function set_wordpress_test_cookie_httponly() {
setcookie( TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN, true, true );
}
add_action('login_init','set_wordpress_test_cookie_httponly');
@dgallegos
dgallegos / microsoft-fabric-mime-type-icons.rb
Created July 5, 2018 18:44
Microsoft Fabric File Icons: Mapping MIME Types to correct icon classes
# References:
#
# Ruby Mime Type code - https://gist.github.com/colemanw/9c9a12aae16a4bfe2678de86b661d922
# Microsoft Fabric Icons - https://developer.microsoft.com/en-us/fabric#/styles/icons
#
def icon_for_mimetype mime
mimes = {
'image': 'Photo2',
'audio': 'Speakers',