Skip to content

Instantly share code, notes, and snippets.

View seedprod's full-sized avatar

John Turner seedprod

View GitHub Profile
@seedprod
seedprod / recursive-set-owners.sh
Created January 8, 2010 15:54
Assign Permission Shell
#!/bin/bash
#loop current folder
for x in *;
#exclude a folder
do if [ $x != 'www' ];
#perform chown use: echo "chown -R $x:'domain users' $x/www/*" to test
then chown -R $x:'domain users' $x/www/*;
fi;
done
@seedprod
seedprod / gist:272610
Created January 9, 2010 00:34
WordPress Loop Shortcode
// The Loop
/*
* Usage: loop category="news" query="" pagination="false"
*/
<?php
add_shortcode("loop", "myLoop");
function myLoop($atts, $content = null) {
extract(shortcode_atts(array(
@seedprod
seedprod / gist:272617
Created January 9, 2010 00:46
Thematic CSS Framework
// add YUI tags and classes
function rhythm_yui_1(){
echo '<div id="custom-doc" class="yui-t6"> <div id="hd">';
}
add_action('thematic_aboveheader','rhythm_yui_1');
function rhythm_yui_3(){
echo '</div><!-- hd --> <div id="bd"> <div id="yui-main"> <div class="yui-b"> <div class="yui-g">';
}
add_action('thematic_belowheader','rhythm_yui_3');
@seedprod
seedprod / stockr.php
Created January 9, 2010 00:50
Stockr Source
<?php
set_include_path('.' . PATH_SEPARATOR . dirname(__FILE__) .PATH_SEPARATOR . '../library');
require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->setFallbackAutoloader(true);
Zend_Loader::loadClass('Zend_Debug');
Zend_Loader::loadClass('Zend_Http_Client');
Zend_Loader::loadClass('Zend_Service_Twitter');
@seedprod
seedprod / gist:272626
Created January 9, 2010 00:56
Thematic Sidebar Logic
<?php
// Sidebar Logic
function childtheme_sidebar_logic() {
function childtheme_sidebar_logic_filter($sidebars_widgets){
if(is_home() || is_single()) {
unset($sidebars_widgets['primary-aside']);
} else {
unset($sidebars_widgets['secondary-aside']);
}
return $sidebars_widgets;
@seedprod
seedprod / wp-blog-defaults.php
Created April 18, 2010 19:01
WP Blog Defaults
<?php
/******************************************************************************************************************
Plugin Name: cets_blog_defaults
Plugin URI:
Description: WordPressMU plugin for site admin to set defaults for new blogs.
Version: 1.2.3
@seedprod
seedprod / theme.html
Created April 19, 2010 00:22
Posterous Theme
<!DOCTYPE HTML>
<html lang="en" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<title>{PageTitle}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="{Description}" />
<meta name="color:Background" content="#ffffff"/>
<meta name="color:Sidebar" content="#231F20"/>
<meta name="color:SidebarGradient" content="#666666"/>
<meta name="color:Accent" content="#ff0000"/>
@seedprod
seedprod / cascadedochack.php
Created June 2, 2010 17:10
Cascade Doctype Hack
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<!--#START-ROOT-CODE
<?php
ob_start();
?>
#END-ROOT-CODE-->
<!--#START-CODE
<?php
ob_end_clean();
@seedprod
seedprod / seatmap.js
Created June 8, 2010 20:23
NY Phil Seatmap JS
var isHttps = false;
var yuiVersion = '2.5.2';
function includeJavaScript(jsFile)
{
document.write('<script type="text/javascript" src="'
+ jsFile + '"></script>');
}
function includeCSS(cssFile)
{
document.write('<link rel="stylesheet" type="text/css" href="'
@seedprod
seedprod / remiupgrade.sh
Created December 2, 2010 15:33
RedHat 5 remi upgrade php to php 5.3.3
wget http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
# yum remove php-mysql
yum --enablerepo=remi update php