Skip to content

Instantly share code, notes, and snippets.

View mattradford's full-sized avatar
👋

Matt Radford mattradford

👋
View GitHub Profile
@spivurno
spivurno / gw-gp-limit-choices-shortcodes.php
Created March 27, 2014 23:38
Gravity Wiz // Gravity Perks // GP Limit Choices // Shortcodes
<?php
/**
* Gravity Wiz // Gravity Perks // GP Limit Choices // Shortcodes
*
* Provides several shortcodes providing the ability to display the number of times a choice has been selected,
* the total number of times a choice can be selected, and the remaining number of times a choice can be selected.
*
* @version 1.0
* @author David Smith <[email protected]>
* @license GPL-2.0+
@tomvdv
tomvdv / codekit2_lazy-commit.sh
Last active July 27, 2016 20:18
CodeKit 2 hook: auto-commit changes to local git repo
# terminal-notifier available at https://github.com/alloy/terminal-notifier
PROJECT_PATH="/Users/username/Path/To/Project/"
GITFILE="$PROJECT_PATH.git"
if [ ! -e $GITFILE ]
then
cd $PROJECT_PATH && git init && git add . && git commit -m 'initial commit'
terminal-notifier -message "Created local git repo with initial commit" -title "CodeKit hook: git"
else
@Rarst
Rarst / composer.json
Last active December 18, 2024 08:20
Test project for WordPress stack via Composer
{
"name" : "rarst/install-test",
"description" : "Test project for WordPress stack via Composer",
"authors" : [
{
"name" : "Andrey Savchenko",
"homepage": "http://www.Rarst.net/"
}
],
"type" : "project",
@WebEndevSnippets
WebEndevSnippets / header.php
Created January 21, 2013 18:02
WordPress: Custom Loop with WP_Query and Transient
function shireman_books_header_loop( $args ) {
global $post;
$defaults = array(
'orderby' => 'rand',
'post_type' => 'we_published-book',
'posts_per_page' => 9,
'post_status' => 'publish',
'no_found_rows' => true, // counts posts, remove if pagination required
'update_post_term_cache' => false, // grabs terms, remove if terms required (category, tag...)
'update_post_meta_cache' => false, // grabs post meta, remove if post meta required
@tjstein
tjstein / nginx-vhost.conf
Created April 5, 2011 00:47
nginx vhost config for WordPress + PHP-FPM
upstream php-fpm {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name www.example.com;
rewrite ^ http://example.com$request_uri?;
}