This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Obtain the path to the admin directory. | |
* | |
* @return string | |
*/ | |
function my_plugin_get_admin_path() { | |
// Replace the site base URL with the absolute path to its installation directory. | |
$admin_path = str_replace( get_bloginfo( 'url' ) . '/', ABSPATH, get_admin_url() ); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CREATE: On the root folder of a Git repository: | |
$ git submodule add git@bitbucket.org:nicethemes/<repo>.git location/of/submodule | |
# Cloning a repo that contains submodules: | |
$ git clone --recursive git@bitbucket.org:nicethemes/<repo>.git location/of/repo | |
# Or: | |
$ git clone git@bitbucket.org:nicethemes/<repo>.git location/of/repo | |
$ git submodule init | |
$ git submodule update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Purge all Varnish cache | |
varnishadm "ban req.url ~ /" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################### | |
# Compress a folder | |
################### | |
tar czfv test.tar.gz test/ | |
# "czfv" stands for "Compress Zip File Verbose" | |
# If you want bzip files, use "j" instead of "z". | |
################### | |
# Uncompress a file | |
################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create ssh directory if it doesn't exist | |
mkdir -p ~/.ssh | |
# Go to ssh directory | |
cd !$ | |
# Create public and private keys | |
ssh-keygen | |
# Upload your publick key to some server | |
cat ~/.ssh/id_rsa.pub | ssh user@host -p 22 "cat - >> ~/.ssh/authorized_keys" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Ignore this line. | |
add_action( 'save_post', 'nice_fix_yoast_seo_loading', -999 ); | |
add_action( 'delete_post', 'nice_fix_yoast_seo_loading', -999 ); | |
function nice_fix_yoast_seo_loading() { | |
if ( ! class_exists( 'WPSEO_Link_Watcher' ) ) { | |
return; | |
} | |
nice_loader( 'includes/public/theming/' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body.nice-framework-page-demos .nice-toggle .nice-toggle-inner { | |
height: auto !important; | |
border: 2px solid transparent !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Prevent Airplane Mode from blocking Google Fonts. | |
add_filter( 'airplane_mode_parse_style', function( $value, $parsed ) { | |
if ( 'fonts.googleapis.com' === $parsed ) { | |
$value = false; | |
} | |
return $value; | |
}, 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -e "\e[32m"; | |
while :; do for i in {1..16}; | |
do r="$(($RANDOM % 2))"; | |
if [[ $(($RANDOM % 5)) == 1 ]]; then | |
if [[ $(($RANDOM % 4)) == 1 ]]; then | |
v+="\e[1m $r "; | |
else | |
v+="\e[2m $r "; | |
fi; | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery( document ).ready( function( $ ) { | |
var scrollable = $('#branding .navbar-inner'); | |
var difference = 5; | |
if ( scrollable.length ) { | |
var a = document.body; | |
var e = document.documentElement; | |
NewerOlder