I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis
onto
the box and here's how I did it and some things to look
out for.
To install:
### | |
# BEGIN MOBILE REDIRECTS | |
### | |
# If the skipMobileDetection cookie is set, and we're on the mobile domain, | |
# return to the normal domain. Do this only for SSL as Varnish will handle | |
# for port 80. | |
RewriteCond %{HTTP_COOKIE} skipmobiledetection [NC] | |
RewriteCond %{HTTP_HOST} ^m\. [NC] | |
RewriteCond %{SERVER_PORT} =443 |
<?php | |
// app/code/local/SW/Core/Model/Design/Package.php | |
class SW_Core_Model_Design_Package extends Mage_Core_Model_Design_Package | |
{ | |
/** | |
* Get the timestamp of the newest file | |
* | |
* @param array $files | |
* @return int $timeStamp |
ErrorDocument 503 /index.html | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule .* /index.html [R=503,L] |
<?php | |
add_filter( 'genesis_attr_content', 'yoast_schema_empty', 20 ); | |
add_filter( 'genesis_attr_entry', 'yoast_schema_event', 20 ); | |
add_filter( 'genesis_attr_entry-title', 'yoast_itemprop_name', 20 ); | |
add_filter( 'genesis_attr_entry-content', 'yoast_itemprop_description', 20 ); | |
add_filter( 'genesis_post_title_output', 'yoast_title_link_schema', 20 ); | |
/** | |
* We'll use the post info output to add more meta data about the event. |
/** Genesis Previous/Next Post Post Navigation */ | |
add_action( 'genesis_before_comments', 'eo_prev_next_post_nav' ); | |
function eo_prev_next_post_nav() { | |
if ( is_single() ) { | |
echo '<div class="prev-next-navigation">'; | |
previous_post_link( '<div class="previous">Previous article: %link</div>', '%title' ); |
delimiter ;; | |
drop procedure if exists build_catalog;; | |
create procedure build_catalog(IN categories INT, IN products INT) | |
begin | |
SET @category_count = 1; | |
SET @CATNAMEPREFIX = "Category "; | |
SET @CATURLKEYPREFIX = "cat-"; | |
SET @CATURLPATHPREFIX = "catpath-"; | |
SET @ROOTCATEGORY = 2; | |
SET @INCLUDEINMENU = 1; |
###################################################### | |
# Redirect to separate directory for mobile site | |
###################################################### | |
# Don't redirect if we're already there! | |
RewriteCond %{REQUEST_URI} !^/mobile/.*$ | |
# Check Cookie to (en|dis)able redirect to mobile or stay on desktop | |
RewriteCond %{HTTP_COOKIE} !^.*mobile.*$ [NC] |
// Requires jQuery of course. | |
$(document).ready(function() { | |
$('.show-comments').on('click', function(){ | |
var disqus_shortname = 'YOUR-DISQUS-USERNAME'; // Replace this value with *your* username. | |
// ajax request to load the disqus javascript | |
$.ajax({ | |
type: "GET", | |
url: "http://" + disqus_shortname + ".disqus.com/embed.js", | |
dataType: "script", |