Skip to content

Instantly share code, notes, and snippets.

View drinkmaker's full-sized avatar
🏠
Working from home

Alexander Khmelnitskiy drinkmaker

🏠
Working from home
View GitHub Profile
@drinkmaker
drinkmaker / index.html
Created February 8, 2020 08:04
Content Protector: What if the user disables JavaScript in the browser settings?
<noscript>
<div id="t42-content-protector-js-disabled">
<div><h3>Please Enable JavaScript in your Browser to Visit this Site.</h3></div>
</div>
<style>
#t42-content-protector-js-disabled {
position: fixed;
top: 0;
left: 0;
height: 100%;
@drinkmaker
drinkmaker / devtools-detect.js
Created July 6, 2021 08:50
Developer Tools Detection
/**
* Disable Developer Tool, HotKeys: Ctrl+Shift+I, ⌘+⌥+I, F12
* Disable to View Source Code of Page by Developer Tools.
**/
function disableDeveloperTool() {
hotkeys( 'command+option+j,command+option+i,command+shift+c,command+option+c,command+option+k,command+option+z,command+option+e,f12,ctrl+shift+i,ctrl+shift+j,ctrl+shift+c,ctrl+shift+k,ctrl+shift+e,shift+f7,shift+f5,shift+f9,shift+f12', function( event, handler ) {
event.preventDefault();
} );
@drinkmaker
drinkmaker / functions.php
Created December 8, 2021 15:46
Remove 'Elementor' state from Pages in admin area.
<?php
/**
* Remove 'Elementor' state from pages in admin area.
*
* @since 1.0.0
* @access public
*
* @param string[] $post_states An array of post display states.
* @param WP_Post $post The current post object.