Skip to content

Instantly share code, notes, and snippets.

View thinkstylestudio's full-sized avatar

Theron Smith thinkstylestudio

View GitHub Profile
@thinkstylestudio
thinkstylestudio / haml-sass builder
Created July 7, 2012 21:01 — forked from peterkappus/haml-sass builder
Haml/Sass builder script (great for Wordpress themes & other HTML-like templates)
require 'digest/md5'
=begin
About:
This script automatically runs on a 2-second loop, searches the current directory for haml & sass files that have been modified since the last iteration and builds them as needed into a file with the same name minus the .haml/sass extension. I wrote it so I could use Haml & Sass to develop Wordpress themes.
How-to:
1) Name your source files with the extension you'd like them to have, then add ".haml" or ".sass" as appropriate...
For example: index.php.haml and styles.css.sass
@thinkstylestudio
thinkstylestudio / function.php
Created August 23, 2012 02:19
Disables all posts on a blog.
// From http://wordpress.stackexchange.com/questions/44983/disable-single-post-page
add_action( 'pre_get_posts', 'single_post_404' );
function single_post_404( $query ) {
if ( $query->is_main_query() && $query->is_single() )
$query->is_404 = true;
}
@thinkstylestudio
thinkstylestudio / .gitignore
Created September 8, 2012 22:07 — forked from ancillaryfactory/.gitignore
Wordpress: Template .gitignore file
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
<?php
// Set these dependant on your BB credentials
$username = 'username';
$password = 'password';
// Grab the data from BB's POST service and decode
$json = stripslashes($_POST['payload']);
$data = json_decode($json);
@thinkstylestudio
thinkstylestudio / README.md
Created September 8, 2012 23:33 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
<?php
/**
Plugin Name: Gravity Forms - Orange44 Customizations
Plugin URI:
Description:
Version: 0.1
Author: Think Style Studio
Author URI: http://thinkstylestudio.com
License: GPL2
<?php
/**
Plugin Name: Gravity Forms - Orange44 Customizations
Plugin URI:
Description:
Version: 0.1
Author: Think Style Studio
Author URI: http://thinkstylestudio.com
License: GPL2
@thinkstylestudio
thinkstylestudio / gist:5052129
Created February 27, 2013 21:55
http://www.gravityhelp.com/forums/topic/multisite-2#position-9 I didn't want to edit the plugin directly so tried to find an alternative way to display the main sites forms on sub sites. In the end I used the gravity forums shortcode filter. To pretty much output my own forms setting my own database prefix. I had trouble with the form submit so …
<?php
add_filter('gform_shortcode_form', 'gform_shortcode_form_mu_override',10,3);
function gform_shortcode_form_mu_override( $shortcode_string, $attributes, $content ){
global $blog_id, $wpdb;
$old_wp_prefix = $wpdb->prefix;
$wpdb->prefix = 'wp_';
<?php
/*
* Plugin Name: Password Reset Removed
* Description: Removes the ability for non admin users to change/reset their passwords.
* Version: 1.0
* Author: Derek Herman
* Author URI: http://valendesigns.com
*/
class Password_Reset_Removed
{
if ($_SERVER['REMOTE_ADDR']=='127.0.0.1') {
define('WP_ENV', 'local');
} elseif ($_SERVER['HTTP_HOST']=='develop.project.com') {
define('WP_ENV', 'develop');
} elseif ($_SERVER['HTTP_HOST']=='master.project.com') {
define('WP_ENV', 'develop');
} else {
define('WP_ENV', 'production');
}