Skip to content

Instantly share code, notes, and snippets.

View nusserstudios's full-sized avatar

Nusser Studios nusserstudios

View GitHub Profile
sudo bash -c 'for i in update {,dist-}upgrade auto{remove,clean}; do apt-get $i -y; done'
curl -O https://releases.hashicorp.com/vagrant/2.2.16/vagrant_2.2.16_x86_64.deb
curl -O https://releases.hashicorp.com/vagrant/2.2.16/vagrant_2.2.16_SHA256SUMS
curl -O https://releases.hashicorp.com/vagrant/2.2.16/vagrant_2.2.16_SHA256SUMS.sig
curl -sS https://keybase.io/hashicorp/key.asc | gpg --import
gpg --verify vagrant_2.2.16_SHA256SUMS.sig vagrant_2.2.16_SHA256SUMS
shasum -a 256 -c <(cat vagrant_2.2.16_SHA256SUMS | grep 64.deb) -s
sudo apt install ./vagrant_2.2.16_x86_64.deb
@nusserstudios
nusserstudios / php-block.js
Created July 30, 2018 16:01 — forked from pento/php-block.js
Converting a shortcode to a block
// License: GPLv2+
var el = wp.element.createElement,
registerBlockType = wp.blocks.registerBlockType,
ServerSideRender = wp.components.ServerSideRender,
TextControl = wp.components.TextControl,
InspectorControls = wp.editor.InspectorControls;
/*
* Here's where we register the block in JavaScript.
@nusserstudios
nusserstudios / readme.md
Created June 4, 2018 12:31 — forked from eddiewebb/readme.md
Hugo JS Searching with Fuse.js
@nusserstudios
nusserstudios / GitCommitEmoji.md
Created May 17, 2018 16:37 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
function dequeue_jquery_migrate( &$scripts){
if(!is_admin()){
$scripts->remove( 'jquery');
$scripts->add( 'jquery', false, array( 'jquery-core' ), '1.10.2' );
}
}
add_filter( ‘wp_default_scripts’, ‘dequeue_jquery_migrate’ );
@nusserstudios
nusserstudios / gist:bb579da699a114433f67b0a25cd59618
Last active April 5, 2018 13:23
WP Conditional Loop within WP Loop
<?php query_posts( 'category_name=NAME&posts_per_page=-1' ); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<a href="<?php echo get_permalink( $id ); ?>">
<?php the_title(); ?>
</a>
<?php the_excerpt(); ?>
<?php endwhile; else : ?>
<?php esc_html_e( 'CUSTOM ERROR MESSAGE HERE.' ); ?>
<?php endif; ?>
@nusserstudios
nusserstudios / gist:3886ca5148bcde213ecec6cc3f72919e
Created April 5, 2018 13:19
Yoast SEO Breadcrumbs with Foundation Markup
<?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<ul class="breadcrumbs">'.'<li>','</li>'.'</ul>'); } ?>
@nusserstudios
nusserstudios / gist:07703f6fcc2b0714d39876bad2b3512a
Created April 5, 2018 13:12
WordPress Conditional Category
<?php if ( in_category('CategoryName') ) { ?>
Content goes here
<?php } else { ?>
Other content goes here (or nothing)
<?php } ?>
@nusserstudios
nusserstudios / header.php
Created July 21, 2016 04:25 — forked from retlehs/header.php
Sage header template for Bootstrap top navbar component
<?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" role="banner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only"><?= __('Toggle navigation', 'sage'); ?></span>