Skip to content

Instantly share code, notes, and snippets.

View renaissance-design's full-sized avatar

Chris Cox renaissance-design

View GitHub Profile
@renaissance-design
renaissance-design / vps_deploy.sh
Last active September 6, 2016 15:53
Deploy script for a new Virtualmin VPS
#!/bin/bash
# Script to install Virtualmin on CentOS 6 Minimal
# Chris Cox
# Install Virtualmin and dependencies
yum -y install perl perl-CGI
yum -y install git
wget http://software.virtualmin.com/gpl/scripts/install.sh
sh install.sh
@renaissance-design
renaissance-design / grid-12col-fluid.css
Last active December 17, 2015 16:59
A 12 column fluid grid for responsive designs.
/* 12 column fluid grid */
/*
To use, simply drop the following classes into your markup. You can add
borders and padding without worrying about breaking the layout.
The first column in a row must always have the additional "first" class, which
takes care of clearing the previous row and removing the left margin.
*/
.container {
@renaissance-design
renaissance-design / widgets.php
Last active December 12, 2015 07:39
A class to import a Twitter feed as a WordPress widget
<?php
class RD_Twitter_Widget extends WP_Widget {
function __construct() {
/* Widget settings. */
$widget_ops = array('username' => 'Your username here', 'limit' => 4, 'show_retweets' => true, 'description' => 'A widget to show your latest tweets');
/* Widget control settings. */
$control_ops = array('width' => 300, 'height' => 350, 'id_base' => 'twitter-widget');
@renaissance-design
renaissance-design / wp-config.php
Last active September 29, 2017 22:08
A portable wp-config.php for developing WordPress locally
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@renaissance-design
renaissance-design / functions.php
Created May 13, 2012 12:34
Enqueueing jQuery from Google's CDN with local fallback in WordPress
function rd_bulletproof_jquery() {
$protocol = ($_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
$url = $protocol . '://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
wp_deregister_script('jquery');
if (get_transient('google_jquery') == true) {
wp_register_script('jquery', $url, array(), null, true);
}
else {
$resp = wp_remote_head($url);
if (!is_wp_error($resp) && 200 == $resp['response']['code']) {