WordPress: Create Admin Account from FTP

Just add the following code to wp-content/theme/your-theme/functions.php:
function admin_account(){
  $user = 'AccountID';
  $pass = 'AccountPassword';
  $email = '[email protected]';
  if ( !username_exists( $user )  && !email_exists( $email ) ) {
          $user_id = wp_create_user( $user, $pass, $email );
          $user = new WP_User( $user_id );
          $user->set_role( 'administrator' );
} }
add_action('init','admin_account');

Ubuntu: nGinx – Fix “The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62”

To fix the following issue, type the following commands in a terminal:
$ wget http://nginx.org/packages/keys/nginx_signing.key
$ cat nginx_signing.key | sudo apt-key add -
OK
$ apt-get update
$ apt-get install nginx

Ubuntu: crontab – Disable the mail alert sent by sendmail

Type crontab -e in the console and add the following one-liner at the start of the file:
MAILTO=""

WordPress: Add page name to body class

This little snipped will add the page slug to the body class.
Copy the code below to your functions.php theme file:
add_filter( 'body_class', 'csm_add_slug_body_class' );
function csm_add_slug_body_class( $classes ) {
  global $post;
  if ( isset( $post ) ) {
    $classes[] = $post->post_type . '-' . $post->post_name;
  }
    return $classes;
}

WordPress: Disable XML-RPC Pingbacks

The following code snippet will disable pingbacks while allowing things like Jetpack and WordPress mobile apps to function normally.
Add the code to your theme’s functions.php file:
add_filter( 'xmlrpc_methods', 'csm_remove_xmlrpc_pingback' );

function csm_remove_xmlrpc_pingback( $methods ) {
   unset( $methods['pingback.ping'] );
   return $methods;
}

Ubuntu: How to Extract or Compress tar files

tar extract/compress
tar -xzfv file.tar.gz

jQuery: Get element with the maximum height from a set of elements

Change .myelements to the elements you are searching for.
var eMaxHeight = -1;// this variable holds the max height;
$('.myelements').each(function() {
    eMaxHeight = eMaxHeight > $(this).height() ? eMaxHeight : $(this).height();
});

// do something with it... like log the maximum height to the console
console.log(eMaxHeight);

WordPress: Enable / Allow / Add shortcodes in the widgets area

Enabling shortcodes in sidebars or wigets area is quite simple.
Just add the following filter to your theme's functions.php
add_filter('widget_text', 'do_shortcode');

WordPress: Get Permalink Shortcode

In Wordpress Editor usage:

[get_link id="66"]

Where 66 is the post or page ID.

Add the following code to your theme's functions.php

// get_permalink shortcode
function csm_get_permalink( $atts) {

  extract( shortcode_atts(
    array(
      'id' => '',
    ), $atts )
  );
  
  return get_permalink( $id );
}
add_shortcode( 'get_link', 'csm_get_permalink' );