Skip to content

Instantly share code, notes, and snippets.

View landbryo's full-sized avatar
🤠
Always Excitied

Landon Otis landbryo

🤠
Always Excitied
View GitHub Profile
@landbryo
landbryo / get_password
Last active May 23, 2018 15:05
Retrieves password for requested email account in Plesk Linux.
Plesk email users often get their passwords lost.
Fortunately Parallels has implemented a command to see all passwords for all users in all domains:
`/usr/local/psa/admin/bin/mail_auth_view`
You can filter the output to see one account password (quotes must exist):
`/usr/local/psa/admin/bin/mail_auth_view | grep "johnsmith@domain.tld"`
@landbryo
landbryo / git-commands
Last active May 23, 2018 15:06
Git commands I've come to find useful and want to find in one place.
git clone https:// // clone repository
git add -A // stages all
git add . // stages new and modified, without deleted
git add -u // stages modified and deleted, without new
git commit -m "add message here" //commit changes with a message
git push origin master //push changes to master branch
git reset --hard
git pull
jQuery('img').removeAttr('title');
@landbryo
landbryo / sheets_filter
Last active May 23, 2018 15:06
Detailed description in file.
`=filter( A2:I, search("Yes", I2:I) )`
### Determins where you start and end. This example starts in cell A2 and ends before column I begins ###
`A2:I`
### Term to search for ###
`"Yes"`
### Determins where you return the results. This example returns the results in column I starting at cell I2 ###
`I2:I`
@landbryo
landbryo / hash-add.html
Last active May 23, 2018 15:07
Adds hashtag to URL based on selected option.
<script>
var url = window.location.href;
if (url.search("country=") >= 0) {
window.location.hash = "#locator";
}
</script>
<a name="locator"></a>
<?php
/*
Plugin Name: Plugin Opener
Plugin URI:
Description:
Version: 1.0
Author: landbryo
Author URI: https://scree.it
License: GPLv2
*/
@landbryo
landbryo / admin_menu
Last active May 24, 2018 16:09
Creates menu in WordPress admin bar.
// ADD TOOLBAR MENU ITEMS //
function add_scree_toolbar($admin_bar){
$menuName = 'You Menu Name';
$screeMenu = wp_get_nav_menu_items($menuName);
$admin_bar->add_menu(array(
'id' => 'parent-item',
'title' => 'Menu',
'href' => '#',
'meta' => array(
@landbryo
landbryo / slick_slider
Last active May 24, 2018 16:11
Functions, jQuery, HTML, and CSS to get started with Slick Slider in WordPress using ACF.
<?php /* FUNCTIONS */ ?>
<?php
///////////////////
// ENQUEUE SLICK //
///////////////////
function enqueue_slick() {
wp_enqueue_script( 'slick-js', '//cdn.jsdelivr.net/jquery.slick/1.4.1/slick.min.js', 'jquery', '1.4.1' );
wp_enqueue_script( 'slick-init-js', trailingslashit( get_stylesheet_directory_uri() ) . 'js/slick-init.js', 'jquery', 1.0 );
@landbryo
landbryo / mysql_dump
Last active May 24, 2018 16:12
Script for dumping a database to /tmp/dbbackup/
#!/bin/sh
rm -rf /tmp/dbbackup/
MYSQL_USER="root"
MYSQL_PASS="password"
NOW=$(date +"%Y-%m-%dT%H_%M_%S")
BACKUP_DIR=/tmp/dbbackup/$NOW
test -d "$BACKUP_DIR" || mkdir -p "$BACKUP_DIR"
# Get the database list, exclude information_schema
for db in $(mysql -B -s -u $MYSQL_USER --password=$MYSQL_PASS -e 'show databases' | grep -v information_schema | grep -v performance_schema)
do
@landbryo
landbryo / wp_match_height.md
Last active May 24, 2018 16:14
This snippet allows you to use the jQuery Match Height plugin in your WordPress theme.

jQuery Match Height's files and documentation can be found here.

Create a file called match.js to house the matchHeight function:

jQuery(document).ready(function($) {

    $(function() {
        $('.match').matchHeight({
 byRow: true,