Skip to content

Instantly share code, notes, and snippets.

<?php
$req_uri = $_SERVER['REQUEST_URI'];
$view = 'page';
if ( $req_uri == '/' || $req_uri == '/about/' ) {
$view = 'page';
} else {
$view = 'post';
}
?>
<body id="<?php echo $view; ?>">
<?php
$conn = mysql_connect('DBHOST:3306', 'DBUSER', 'DBPASS');
mysql_select_db('SCHEMA', $conn) or die('Cannot connect to the database');
?>
@blister
blister / GameBase.cpp
Created April 13, 2010 14:25
Base code for the Eric Harrison Game Development Project
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_ttf.h"
#include <string>
// set up my drawing window
const int SCREEN_WIDTH = 1024;
const int SCREEN_HEIGHT = 768;
const int SCREEN_BPP = 32;
const int CONSOLE_WIDTH = 200;
<?php
is_home();
is_single();
is_page();
is_search();
is_404();
?>
RewriteEngine On
RewriteBase /
RewriteRule ^js/(.+)$ js/$1 [L]
RewriteRule ^css/(.+)$ css/$1 [L]
RewriteRule ^images/(.+)$ images/$1 [L]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.+)$ index.php?path=$1&%{QUERY_STIRNG} [L]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title><?php echo $AppName->title(); ?></title>
<link rel="stylesheet" type="text/css" href="/css/reset-fonts-grids.css" />
<link rel="stylesheet" type="text/css" href="/css/appname.css" />
<?php
if ( $AppName->view_css() ) {
?>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.) /index.php?path=$1 [L]
# BEGIN W3 Total Cache
<IfModule mod_setenvif.c>
SetEnvIfNoCase Accept-Encoding (gzip) APPEND_EXT=.$1
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} \/$
RewriteCond %{REQUEST_URI} !(\/wp-admin\/|\/xmlrpc.php|\/wp-(app|cron|login|register).php|wp-.*\.php|index\.php) [
OR]
@blister
blister / public.php
Created May 12, 2010 17:49
SexyBookmarks plugin fork to add Facebook "Like" buttons
376a377,381
>
> // Facebook "Like" button fork, http://ericharrison.info/142
> $socials .= '<br /><iframe src="http://www.facebook.com/plugins/like.php?href=' . $fetch_url . '&amp;layout=standard&amp;show-faces=false&amp;width=450&amp;action=like&amp;font=lucida+grande&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:30px; display:block;"></iframe>' . "\n";
> // end of Facebook "Like" button fork.
>
RECIPE_NAME.zip
++ RECIPE_README.md
++ includes/
includes/PainfreeConfig-RECIPENAME.php
includes/RECIPENAME.php
++ templates/
templates/(ANY RECIPE TEMPLATES)
++ htdocs/
htdocs/images/(ANY RECIPE PUBLIC IMAGES)
htdocs/css/(ANY RECIPE PUBLIC CSS)