Skip to content

Instantly share code, notes, and snippets.

@zamoose
zamoose / config_definitions.pp
Created August 25, 2011 20:00
Useful Puppet user definitions
# Hopefully someone else will find these snippets useful. I've found them VERY
# helpful in defining local users that hew to the generally-accepted RedHat-ism
# of [local username] having an equivalent [local user primary group] with uid = gid.
# Improvements welcomed.
#
# ROCKS Cluster users generally need access to scratch directories on local storage,
# hence their more expansive definitions.
#
# This file should probably go in your [Puppet config dir]/manifests/definitions/
#
<?php
// Set up arrays to hold the post objects
$rotator_items = $testimonial_items = array();
// Loop through rotator items
$rotator_args = array( 'post_type' => 'rotator' );
$rotator = new WP_Query( $rotator_args );
$c1 = 0;
@zamoose
zamoose / functions.php
Created March 3, 2012 03:23
Elbee Elgee child theme
<?php
remove_action( 'lblg_after_itemtext', 'lblg_post_info' );
@zamoose
zamoose / functions.php
Created March 12, 2012 15:38
BP reordering
<?php
/**
* This function rearranges BuddyPress navigation elements.
*/
function npat_alter_group_options(){
global $bp;
if(NPAT_DEBUG) echo '<pre>';
$slug = $bp->groups->current_group->slug;
$nav_array = $bp->bp_options_nav;
@zamoose
zamoose / functions.php
Created March 19, 2012 16:27
Hook output
<?php
function lbc_hook_check(){
global $wp_filter;
$tmp_filters = $wp_filter;
foreach( $tmp_filters as $key => $values ) {
if( preg_match( '/^lblg/', $key ) ) {
add_action($key, 'lbc_hook_echo');
@zamoose
zamoose / gist:4150576
Created November 26, 2012 20:59
LESS
/*
New and improved solution, available in a master LESS file for use anywhere.
*/
.setwidth(@width, @defaultw) when (isnumber(@width)){
width: @width;
}
.setwidth(@width, @defaultw) when not(isnumber(@width)){
width: @defaultw;
}
@zamoose
zamoose / gist:5674441
Created May 29, 2013 22:47
Useful ssh shell expansion
complete -W "$(echo $(grep '^ssh ' .bash_history | sort -u | sed 's/^ssh //'))" ssh

Keybase proof

I hereby claim:

  • I am zamoose on github.
  • I am zamoose (https://keybase.io/zamoose) on keybase.
  • I have a public key whose fingerprint is 11CB D1D6 8323 1C5B 1BD1 3809 81A8 AEA1 CD1B 3B5A

To claim this, I am signing this object:

map $uri $blogname{
~^(?P<blogpath>/[^/]+/)files/(.*) $blogpath ;
}
map $blogname $blogid{
default -999;
#Ref: http://wordpress.org/extend/plugins/nginx-helper/
#include /var/www/wordpress/wp-content/plugins/nginx-helper/map.conf ;
}
@zamoose
zamoose / domains.yml
Last active August 29, 2015 14:14
Proposed HGV YAML format
---
# Root-level array members should roughly line up with
# Ansible host groups
# Top level Ansible group containing HGV info.
# Should probably only ever contain one host.
vagrant_hosts:
# These map to the "hosts:" portion of the inventory
hgv.dev:
# Everything per-host maps to the "vars:" portion of the inventory