Skip to content

Instantly share code, notes, and snippets.

View ebinnion's full-sized avatar

Eric Binnion ebinnion

View GitHub Profile
@ebinnion
ebinnion / Javascript (using jQuery)
Created December 23, 2011 08:57
Jquery Modal Window
$(document).ready(function() {
//select all the a tag with name equal to modal
$('a[name=modal]').click(function(e) {
//Cancel the link behavior
e.preventDefault();
//Get the A tag
var id = $(this).attr('href');
@ebinnion
ebinnion / .m file
Created January 4, 2012 16:08
Add polygon overlay to mapkit iOS
- (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id<MKOverlay>)overlay
{
if ([overlay isKindOfClass:[MKPolygon class]])
{
MKPolygonView* aView = [[MKPolygonView alloc]initWithPolygon:(MKPolygon*)overlay];
aView.fillColor = [[UIColor cyanColor] colorWithAlphaComponent:0.2];
aView.strokeColor = [[UIColor blueColor] colorWithAlphaComponent:0.7];
aView.lineWidth = 3;
return aView;
}
@ebinnion
ebinnion / .m File
Created January 17, 2012 08:51
Set map region in iOS Mapkit
CLLocationCoordinate2D location;
location.latitude=yourlatitude;
location.longitude=yourlongitude;
span.latitudeDelta=0.01; //or whatever zoom level
span.longitudeDelta=0.01;
region.span=span;
region.center=location;
@ebinnion
ebinnion / hideMenu.js
Created January 24, 2012 05:12
Jquery Hide/Show Menu Responsive Web Design
$('#menu-button').click(function(){
$('.menu').slideToggle('fast',function() {});
});
function menuHide (){
if ($(window).width() < 1024){
$("body").addClass("mobile");
}
else {
$("body").removeClass("mobile");
@ebinnion
ebinnion / Recommended Shortcode
Created March 25, 2012 22:14
Thesis Shortcodes
@ebinnion
ebinnion / Rotating Header Image
Created April 1, 2012 00:52
Thesis Hooks Reference
// This code will add a rotating header image to Thesis
function header_rotator() {
echo thesis_image_rotator();
}
add_action('thesis_hook_feature_box','header_rotator');
@ebinnion
ebinnion / Body Code
Created April 6, 2012 05:16
Embed Google Map with Geocode
<div id="map" style="width: 413px; height: 300px;"></div>
<script type="text/javascript">
var mapOptions = {
zoom: 16,
center: new google.maps.LatLng(54.00, -3.00),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var geocoder = new google.maps.Geocoder();
var address = '3410 Taft Blvd Wichita Falls, TX 76308';
geocoder.geocode( { 'address': address}, function(results, status) {
@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');
@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: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';}"