Skip to content

Instantly share code, notes, and snippets.

View wpsmith's full-sized avatar

Travis Smith wpsmith

View GitHub Profile
@wpsmith
wpsmith / README.md
Created September 25, 2015 12:12 — forked from jonathantneal/README.md
SASS @font-face mixin

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@wpsmith
wpsmith / get-post-types-supporting.php
Created September 24, 2015 18:44 — forked from wpscholar/get-post-types-supporting.php
A custom WordPress function to fetch a list of registered post types that support a specific feature.
<?php
/**
* Get a list of post types that support a specific feature.
*
* @param $feature
* @return array
*/
function get_post_types_supporting( $feature ) {
global $_wp_post_type_features;
@wpsmith
wpsmith / gravityforms.scss
Last active September 21, 2015 23:38 — forked from JodiWarren/gravityforms.scss
Style Gravity Forms with Bootstrap 3 (SASS) - From: http://roots.io/style-gravity-forms-with-bootstrap/
.gform_wrapper ul {
@extend .list-unstyled;
}
.gform_wrapper li {
@extend .form-group;
}
.gform_wrapper form {
margin-bottom: 0;
}
.gform_wrapper .gfield_required {
@wpsmith
wpsmith / new_gist_file.css
Last active September 21, 2015 23:36 — forked from spigists/new_gist_file.css
Bootstrap 3 styles for Gravity Forms, make sure that in Forms > Settings you have Output CSS set to No and Output HTML5 set to Yes
.gform_wrapper ul {
padding-left: 0;
list-style: none; }
.gform_wrapper li {
margin-bottom: 15px; }
.gform_wrapper form {
margin-bottom: 0; }
@wpsmith
wpsmith / fix-wordpress-permissions.sh
Last active September 18, 2015 21:12 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@wpsmith
wpsmith / .bash_profile
Last active September 18, 2015 20:39 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@wpsmith
wpsmith / gist:69b098157391b9eee174
Last active August 25, 2015 20:02 — forked from billerickson/gist:1298344
Full Content in Display Posts Shortcode plugin
<?php
/**
* Full Content in Display Posts Shortcode plugin
* @author Bill Erickson
* @link http://wordpress.org/extend/plugins/display-posts-shortcode/
*
* @param string $output the original markup for an individual post
* @param array $atts all the attributes passed to the shortcode
* @param string $image the image part of the output
* @param string $title the title part of the output
@wpsmith
wpsmith / Vagrantfile
Last active August 29, 2015 14:27
Vagrant PHP Dev
Vagrant::Config.run do |config|
config.vm.customize do |vm|
vm.name = "PHP dev"
vm.memory_size = 512
end
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "ubuntu32"
# Assign this VM to a host only network IP, allowing you to access it
@wpsmith
wpsmith / fittext.scss
Last active August 29, 2015 14:27 — forked from tedw/fittext.scss
FitText Sass Mixin - Based on https://github.com/bookcasey/fittext by @bookcasey
// FitText Mixin
// Based on https://github.com/bookcasey/fittext by @bookcasey
@mixin fittext( $min-font-size: 20px, $max-font-size: 80px, $font-increment: 2px, $min-media: 320px, $max-media: auto, $media-increment: auto, $ratio: 1 ) {
$font-size: $min-font-size;
$media: $min-media;
// If no max width or increment, set a max of 1200px
@if ( $max-media == 'auto' and $media-increment == 'auto' ) {
$max-media: 1200px;
}
@wpsmith
wpsmith / disable-plugins-when-doing-local-dev.php
Last active August 29, 2015 14:26 — forked from markjaquith/disable-plugins-when-doing-local-dev.php
Disables specified WordPress plugins when doing local development
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/