Skip to content

Instantly share code, notes, and snippets.

@mccabe615
mccabe615 / phpdangerousfuncs.md
Last active November 7, 2024 05:44
Dangerous PHP Functions

Command Execution

exec           - Returns last line of commands output
passthru       - Passes commands output directly to the browser
system         - Passes commands output directly to the browser and returns last line
shell_exec     - Returns commands output
\`\` (backticks) - Same as shell_exec()
popen          - Opens read or write pipe to process of a command
proc_open      - Similar to popen() but greater degree of control
pcntl_exec - Executes a program
@meain
meain / loading_messages.js
Last active November 16, 2024 02:23
Funny loading messages
export default [
"Reticulating splines...",
"Generating witty dialog...",
"Swapping time and space...",
"Spinning violently around the y-axis...",
"Tokenizing real life...",
"Bending the spoon...",
"Filtering morale...",
"Don't think of purple hippos...",
"We need a new fuse...",
@asufian97
asufian97 / nav menu li and a active.php
Last active November 18, 2022 08:06
wordpress nav menu li add class and li >a>active class
/add li class
function atg_menu_classes($classes, $item, $args) {
if($args->theme_location == 'wpj-main-menu') {
$classes[] = 'hvr-bounce-to-bottom';
}
return $classes;
}
add_filter('nav_menu_css_class','atg_menu_classes',1,3);
//li a add class
@lmeyer
lmeyer / gist:f506a67462bf7614877a205db431bd55
Created October 13, 2016 16:21
Make WP Super Cache works with Bedrock
define( 'WP_CACHE', true );
define( 'WPCACHEHOME', $webroot_dir . '/app/plugins/wp-super-cache/');
@mattclements
mattclements / function.php
Last active October 29, 2024 22:04
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}