Skip to content

Instantly share code, notes, and snippets.

View ebinnion's full-sized avatar

Eric Binnion ebinnion

View GitHub Profile
@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 / 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: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 / 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: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 / 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: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 / gist:4239445
Created December 8, 2012 09:12
jQuery Plugin Skeleton
(function( $ ) {
$.fn.myPlugin = function() {
// Do your awesome plugin stuff here
};
})( jQuery );
@ebinnion
ebinnion / create.txt
Last active December 10, 2015 13:09
Create Table MySQL
CREATE TABLE tutorials_tbl(
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(100) NOT NULL,
slug VARCHAR(40) NOT NULL,
content VARCHAR(2000) NOT NULL,
PRIMARY KEY ( id )
) AUTO_INCREMENT=15110;
@ebinnion
ebinnion / gist:4439337
Last active December 10, 2015 13:09
MySQL queries
CREATE TABLE results(
id INT NOT NULL AUTO_INCREMENT,
1sttitle VARCHAR(100) NOT NULL,
2ndtitle VARCHAR(100) NOT NULL,
3rdtitle VARCHAR(100) NOT NULL,
1stmsg VARCHAR(300) NOT NULL,
2ndmsg VARCHAR(300) NOT NULL,
3rdmsg VARCHAR(300) NOT NULL,
1stscore VARCHAR(100) NOT NULL,
2ndscore VARCHAR(100) NOT NULL,