Skip to content

Instantly share code, notes, and snippets.

View ebinnion's full-sized avatar

Eric Binnion ebinnion

View GitHub Profile
@ebinnion
ebinnion / gist:4229923
Created December 7, 2012 01:14
Parse Imap emails
// http://ca.php.net/imap
$mb = imap_open("{host:port/imap}","username", "password" );
$messageCount = imap_num_msg($mb);
for( $MID = 1; $MID <= $messageCount; $MID++ )
{
$EmailHeaders = imap_headerinfo( $mb, $MID );
$Body = imap_fetchbody( $mb, $MID, 1 );
doSomething( $EmailHeaders, $Body );
@ebinnion
ebinnion / css
Created December 5, 2012 04:05
Fluid Background Image
div.column {
/* The background image must be 800px wide */
max-width: 800px;
}
figure.fluidratio {
padding-top: 10%; /* slope */
height: 120px; /* start height */
background-image: url(http://voormedia.com/examples/amsterdam.jpg);
@ebinnion
ebinnion / gist:4201369
Created December 4, 2012 06:59
Open Graph Tags
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="video.movie" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />
<!--
og:audio - A URL to an audio file to accompany this object.
og:description - A one to two sentence description of your object.
og:determiner - The word that appears before this object's title in a sentence. An enum of (a, an, the, "", auto). If auto is chosen, the consumer of your data should chose between "a" or "an". Default is "" (blank).
og:locale - The locale these tags are marked up in. Of the format language_TERRITORY. Default is en_US.
@ebinnion
ebinnion / gist:4201277
Last active October 13, 2015 13:17
Easy Social Share Links
<!-- Delicious -->
<a title="Share this on del.icio.us" href="http://del.icio.us/post?url=http://yourwebsite.com&title=Your Ttitle"> Boorkmak on del.icio.us </a>
<!-- Digg -->
<a title="Submit to Digg" href="http://digg.com/submit?url=http%3A//yourwebsite.com/&amp;title=Your%3Website%Name"> Post on Digg </a>
<!-- Reddit -->
<a title="Share this on Reddit" href="http://reddit.com/submit?url=http://iamkawsar.com&title=Your Website Name">Post on on Reddit</a>
<!-- Facebook -->
@ebinnion
ebinnion / gist:4197977
Last active October 13, 2015 12:47
Floating and Docking Sharebar
jQuery(document).ready(function($){
// Let's get the position of our sharebar container(where we want it)
// Cache these DOM traversals
var container = $('.content');
var containerOffset = container.offset().top;
var containerLeft = container.offset().left;
var containerBottom = containerOffset + container.height();
var sharebar = $('.viralshare');
var sharebarHeight = 432;
@ebinnion
ebinnion / Sidebar CSS
Created August 1, 2012 15:33
Social Sharing Buttons Thesis
#sharebar {
left:-80px;
top: 100px;
position: absolute;
width: 67px;
background: #fff;
padding: 0;
text-align: center;
border: 1px solid #ccc;
list-style: none;
@ebinnion
ebinnion / gist:2394452
Created April 15, 2012 19:37 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@ebinnion
ebinnion / gist:2356749
Created April 11, 2012 03:57
onFocus & onBlur
onfocus="if (this.value == 'Enter Your Email') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Enter Your Email';}"
@ebinnion
ebinnion / gist:2356113
Created April 11, 2012 01:18
Gravity Forms Custom Logic - AOB
<?php
/*
Plugin Name: Hosting Quiz Logic
Plugin URI: http://www.artofblog.com
Description: Custom logic for Gravity Forms Quiz
Version: 1.0
Author: Eric Binnion
Author URI: http://ericbinnion.com
*/
@ebinnion
ebinnion / gist:2346560
Created April 9, 2012 21:09
Gravity Forms Pre-Submission and Notification
// http://www.gravityhelp.com/forums/topic/simple-calculations
// change the 41 here to your form ID
add_action('gform_pre_submission_41', 'ch_awesomeness_rating');
function ch_awesomeness_rating($form) {
// set up one array for each step of the form
// each array contains the input IDs of the fields we want to sum on each page
// IDs do not need to be consecutive using this method
$step_1_fields = array('input_2', 'input_3', 'input_4', 'input_5', 'input_6', 'input_7', 'input_8', 'input_9', 'input_10', 'input_11');
$step_2_fields = array('input_14', 'input_15', 'input_16', 'input_17', 'input_18', 'input_19', 'input_20', 'input_21', 'input_22', 'input_23');