Skip to content

Instantly share code, notes, and snippets.

View maneja81's full-sized avatar
💭
eat; sleep; code; repeat;

Mohit Aneja maneja81

💭
eat; sleep; code; repeat;
View GitHub Profile
@maneja81
maneja81 / custom-menu-panel.php
Created September 27, 2017 14:28 — forked from nikolov-tmw/custom-menu-panel.php
This registers a custom meta box for nav menus and renders it. Obviously $my_items would ideally be not hard-coded and instead it would come somewhere from the DB. The custom items add to the menu and save properly, but will probably not be displayed correctly. You might need to hook to the 'wp_setup_nav_menu_item' filter in order to fix the men…
<?php
function my_register_menu_metabox() {
$custom_param = array( 0 => 'This param will be passed to my_render_menu_metabox' );
add_meta_box( 'my-menu-test-metabox', 'Test Menu Metabox', 'my_render_menu_metabox', 'nav-menus', 'side', 'default', $custom_param );
}
add_action( 'admin_head-nav-menus.php', 'my_register_menu_metabox' );
/**
@maneja81
maneja81 / CSS Close Symbol
Created December 26, 2019 08:21
Close button in pure css
.close-button {
position: absolute;
top: 0;
right: 0;
width: 48px;
height: 48px;
background: #41415B;
border-radius: 48px;
margin-top: -24px;
@maneja81
maneja81 / run-in-terminal
Last active September 2, 2021 03:00
Commands to generate RSA private and public keys of 4096 bits encrypted via AES256
# Private key
$ openssl genrsa -passout pass:{STRONG-PASSWORD} -out {PATH}/private.pem -aes256 4096
# Pulbic key from the
$ openssl rsa -passin pass:{STRONG-PASSWORD} -pubout -in {PATH}/private.pem -out {PATH}/public.pem