Skip to content

Instantly share code, notes, and snippets.

View leoken's full-sized avatar

Erik James Albaugh leoken

  • Maintain Web
  • Long Beach, CA
  • X @leoken
View GitHub Profile
@leoken
leoken / StripeTutorialPage.html
Created September 22, 2012 04:33 — forked from boucher/StripeTutorialPage.html
Stripe Tutorial Payment Form
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
// this identifies your website in the createToken call below
@leoken
leoken / alerts.less
Created October 14, 2012 23:42
Bootstrap v2.1.1 + Gravity Forms
//
// Alerts
// --------------------------------------------------
// Base styles
// -------------------------
.alert,
.validation_error,
@leoken
leoken / main.js
Created October 16, 2012 01:56
DOM-based routing based on WordPress body_class()
// http://paulirish.com/2009/markup-based-unobtrusive-comprehensive-dom-ready-execution/
// Modified to only fire on body class (not body class + ID, working off strictly WordPress body_class)
Roots = {
// all pages
common: {
init: function(){
// $('a').click(function() {
// alert('Hello world!');
@leoken
leoken / gist:3896862
Created October 16, 2012 01:57
Subnav widget
<?php
/**
* Subnav widget
*
* Base CSS:
*
* .widget_roots_subpages ul {
* margin-top: 10px;
* padding: 0;
@leoken
leoken / gist:3896863
Created October 16, 2012 01:57 — forked from retlehs/gist:2703644
Add a class to widgets in a specific sidebar
<?php
/**
* Add 'class="span4"' to all widgets in the Content Bottom sidebar
*/
function bb_content_bottom_widget_class($params) {
if ($params[0]['id'] == 'roots-content-bottom') {
$class = 'class="span4 ';
$params[0]['before_widget'] = preg_replace('/class=\"/', "$class", $params[0]['before_widget'], 1);
}
@leoken
leoken / wordpress-htaccess-rackspace-sites
Created December 1, 2012 04:33 — forked from rachelbaker/wordpress-htaccess-rackspace-sites
Rackspace Cloud .htaccess file fixes for WordPress
# PHP Site Settings for Rackspace Cloud Sites
php_value max_execution_time 3600
php_value upload_max_filesize 100M
php_value post_max_size 220M
php_value memory_limit 256M
# End PHP Site Settings
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
@leoken
leoken / gist:4180564
Created December 1, 2012 04:33 — forked from cearls/gist:1245316
Rackspace Cloud Site backup script
#!/bin/bash
export ACCOUNT_ROOT="account root"
export WEB_ROOT="${ACCOUNT_ROOT}/web/content"
export DB_HOST="db host"
export DB_USER="db user"
export DB_PASSWORD="db password"
export DB_NAME="db name"
echo "Rotating backups..."
@leoken
leoken / rscapi.php
Created December 1, 2012 04:35 — forked from icambridge/rscapi.php
Rackspace Cloud Server API PHP Library - modified
<?php
/**
* Rackspace Cloud Server API PHP Library
*
* @package RscApi
*/
/**
* Rackspace Cloud Server API PHP Library
*
<?php
function getDateDiff($date)
{
$diff_info=array();
$timestamp=strtotime($date);
$timestamp_diff=$timestamp-time();
//test if $date is future
$diff_info['future']=$timestamp_diff>0;
<?php
/**
* Register Styles and Scripts
*/
add_action( 'wp_enqueue_scripts', 'ft_scripts_styles' );
function ft_scripts_styles() {