Skip to content

Instantly share code, notes, and snippets.

View mavieth's full-sized avatar

Michael Vieth mavieth

  • Denver, CO
View GitHub Profile
<?php
// This file assumes that you have included the nav walker from https://github.com/twittem/wp-bootstrap-navwalker
// somewhere in your theme.
?>
<header class="banner navbar navbar-default navbar-static-top material-static-top" role="banner">
<div class="container">
<div class="navbar-header material-header">
<link href='https://fonts.googleapis.com/css?family=Roboto:400,900,700,300' rel='stylesheet' type='text/css'>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only"><?= __('Toggle navigation', 'sage'); ?></span>
@mavieth
mavieth / colors.sh
Created February 26, 2016 19:36
Bash script color output
#!/bin/bash
DARKGRAY='\033[1;30m'
RED='\033[0;31m'
LIGHTRED='\033[1;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
LIGHTPURPLE='\033[1;35m'
@mavieth
mavieth / Hexo-Generator.sh
Last active February 27, 2016 01:34
Installs Hexo Based Website.
#!/bin/bash
DARKGRAY='\033[1;30m'
RED='\033[0;31m'
LIGHTRED='\033[1;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
LIGHTPURPLE='\033[1;35m'
<?php
add_action('pre_get_posts', 'filter_categories_homepage');
function filter_categories_homepage($query) {
if ($query->is_main_query() && is_home()) {
$query->set('category_name','tutorials');
}
}
?>
@mavieth
mavieth / gist:f2d9b7451fc23090f73f
Created March 29, 2016 00:44
BannerMetaTag.php
<!-- Chrome, Firefox OS and Opera -->
<meta name="theme-color" content="#4285f4">
<!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#4285f4">
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-status-bar-style" content="#4285f4">
$white: #ffffff;
$black: #000000;
$red50: #ffebee;
$red100: #ffcdd2;
$red200: #ef9a9a;
$red300: #e57373;
$red400: #ef5350;
$red500: #f44336;
$red600: #e53935;
$red700: #d32f2f;
#!/bin/bash
# in ~/Sites directory
for D in *; do
if [ -d "${D}" ]; then
wp --path=$D/ core update
wp --path=$D/ theme update --all
wp --path=$D/ plugin update --all
fi
done
#!/bin/bash -e
# First do apt-get update
/usr/bin/sudo apt-get update
# Then the upgrade
/usr/bin/sudo apt-get -y upgrade
# Finally rpi-update
/usr/bin/sudo rpi-update
sudo find wp-content/ -type f -exec chmod 644 {} \;
sudo find -type f -exec chmod 644 {} \;