Dark Launch

This is a Dark Launch.

CSS Unselectable Cross-browser Property

The user-select CSS Property determines whether the content of an element is selectable. To loosely disable this ability, use the following cross-browser solution.

CSS
.unselectable {
   -moz-user-select: -moz-none;
   -ms-user-select: none;
   -khtml-user-select: none;
   -webkit-touch-callout: none;
   -webkit-user-select: none;
   -o-user-select: none;
   user-select: none;
}
CSS
/* override unselectable */
.unselectable {
   -moz-user-select: auto !important;
   -ms-user-select: auto !important;
   -khtml-user-select: auto !important;
   -webkit-touch-callout: auto !important;
   -webkit-user-select: auto !important;
   -o-user-select: auto !important;
   user-select: auto !important;
}

PHP determine if using SSL HTTPS or HTTP

To determine if SSL is used, the is_ssl() function will return True if the page is using SSL (HTTPS or on Port 443), False if not used.

PHP
// from wordpress/wp-includes/functions.php
function is_ssl() {
   if ( isset($_SERVER['HTTPS']) ) {
       if ( 'on' == strtolower($_SERVER['HTTPS']) )
           return true;
       if ( '1' == $_SERVER['HTTPS'] )
           return true;
   } elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' ==
$_SERVER['SERVER_PORT'] ) ) {
       return true;
   }
   return false;
}

Vim remove trailing spaces

To remove all trailing spaces in vim, use the following command:

Code
:%s/ \{1,}\n/\r/gc
 

Explained:

Code
: - command
%s - entire selection
/ - separator
 \{1,}\n - search for one or more spaces followed by a newline
/ - separator
\r - replace with a newline
/ - separator
g - global replace
c - confirm replacements (type y (yes) to confirm replacements)