Skip to content

Instantly share code, notes, and snippets.

View bgallagh3r's full-sized avatar

Brian Gallagher bgallagh3r

View GitHub Profile
Dungeon World -- Season 1, Episode 1
It started with the dreams.
The ancient elf was always sitting across from you in a chair made of some weird metal and fabric mesh you could never
quite identify. He always mentioned you by name...but never mentioned his own name.
He reminded you of the battle over a thousand years ago where the forces led by the HordeKing won their battle against the
elves and their allies, opening a portal that blasted the landscape with magical energy and pulled almost the entire Great
Allied Army through the gate.
@nkarpeev
nkarpeev / gist:5fb28d13e0aa02494d1464ecea374fd1
Created December 11, 2018 14:35
Using the_posts_pagination for custom page template WordPress
// Define page_id
$page_ID = get_the_ID();
// Define paginated posts
$page = get_query_var( 'page' );
// Define custom query parameters
$args = array(
'post_type' => array( 'post', 'book', 'movie' ), // post types
'posts_per_page' => 5,
@ciorici
ciorici / index.php
Created April 27, 2017 08:10
Featured Products Loop in WooCommerce 3.0
<ul class="products">
<?php
$args = array(
'post_type' => 'product',
'posts_per_page' => 12,
'tax_query' => array(
array(
'taxonomy' => 'product_visibility',
'field' => 'name',
'terms' => 'featured',
@phillipwilhelm
phillipwilhelm / gp-nested-forms-sum-nested-form-fields.php
Created September 5, 2016 04:43 — forked from spivurno/gp-nested-forms-sum-nested-form-fields.php
Gravity Perks // GP Nested Forms // Get Sum of Nested Form Field Column
<?php
/**
* Gravity Wiz // Gravity Perks // Get Sum of Nested Form Fields
*
* Get the sum of a column from a Gravity Forms List field.
*
* @version 1.3
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
@petenelson
petenelson / wordpress-list-users.sql
Created May 3, 2016 18:00
WordPress: MySQL query to list user names, emails, and first & last name
SELECT wp_users.user_login, wp_users.user_email, firstmeta.meta_value as first_name, lastmeta.meta_value as last_name FROM wp_users left join wp_usermeta as firstmeta on wp_users.ID = firstmeta.user_id and firstmeta.meta_key = 'first_name' left join wp_usermeta as lastmeta on wp_users.ID = lastmeta.user_id and lastmeta.meta_key = 'last_name'
@le717
le717 / gist:c698671893aa2a1ab8ac
Last active May 9, 2018 13:50 — forked from howtogeek/gist:6b3ed7d917900229b37e
Change font to Comic Sans if reader is using Adblock (and display a message at the top)
<script type="text/javascript">
var iframe = document.createElement("iframe");
iframe.height = "1px";
iframe.width = "1px";
iframe.id = "ads-text-iframe";
iframe.src = "/adframe.js";
document.body.appendChild(iframe);
var a = [
"In a world free from ads, one font reigns supreme. COMIC SANS!",
@websmith
websmith / wp.sh
Last active August 29, 2015 14:07 — forked from bgallagh3r/wp.sh
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
@tlongren
tlongren / functions.php
Last active September 24, 2018 13:48
Add Open Graph Markup to WordPress Theme
<?php
function add_opengraph_markup() {
if (is_single()) {
global $post;
if(get_the_post_thumbnail($post->ID, 'thumbnail')) {
$thumbnail_id = get_post_thumbnail_id($post->ID);
$thumbnail_object = get_post($thumbnail_id);
$image = $thumbnail_object->guid;
} else {
// set default image
@JeffreyWay
JeffreyWay / .bash_profile
Created May 8, 2013 18:02
Laravel aliases
# laravel new-app
alias laravel="git clone -o laravel -b develop https://github.com/laravel/laravel.git"
alias artisan="php artisan"
alias migrate="php artisan migrate"
alias serve="php artisan serve"
alias dump="php artisan dump"
alias t="phpunit"
# Generators Package