Skip to content

Instantly share code, notes, and snippets.

View adesignl's full-sized avatar

Chad Pierce adesignl

View GitHub Profile
@adesignl
adesignl / gist:5783403
Created June 14, 2013 16:39
Double Tap To Go That I Got from Osvaldas Valutis
/*
AUTHOR: Osvaldas Valutis, www.osvaldas.info
$( '#nav li:has(ul)' ).doubleTapToGo();
*/
;(function( $, window, document, undefined )
{
$.fn.doubleTapToGo = function( params )
{
if( !( 'ontouchstart' in window ) &&
@adesignl
adesignl / rss.js
Created June 11, 2013 19:24
RSS Feed Gist
// RSS Feed Reader
$("#feed").rss( "http://insights53.web13.hubspot.com/CMS/UI/Modules/BizBlogger/rss.aspx?tabid=1454980&moduleid=3165550&maxcount=25&u=107275&t=5b81a12cee49e9f3c3580fe7d23f0de2", {
limit: 3,
ssl: false,
layoutTemplate: '<div class="feed-container">{entries}</div>',
entryTemplate: '<div class="entry"><b><a href="{url}">{title}</a></b><p>{shortBodyPlain}</p></div>'
});
@adesignl
adesignl / gist:5715763
Created June 5, 2013 17:45
JQuery Do Something Based On URL String
// Change Body Class Based On URL String
var url = location.pathname;
if (url.indexOf('INSERT STRING HERE') > -1) { //Does It Contain This String?
// Do Somthing Here Like Change Body Class
}
@adesignl
adesignl / mobile.css
Created May 17, 2013 20:42
Add Mobile Styles To Old Hubspot Site
// Mobile Ready STYLES
if($('#outer').length !== 0){
$('head#Head').append('<link href="/Portals/251472/css/mobile.css" rel="stylesheet" />');
}For Development //?' + Math.floor((Math.random()*10)+1) + '
@adesignl
adesignl / Hover CTAs.html
Created May 14, 2013 20:04
Hover State Script for Hubspot CTAs - Place after CTAs
<span class="hs-cta-node hs-cta-e4459cb8-88cc-4881-aed2-73d3e8c4f4fc" id="hs-cta-e4459cb8-88cc-4881-aed2-73d3e8c4f4fc" data-title="Click me!" data-img="/i/buttons/bgbutton_try.png" data-onimg="/i/buttons/bgbutton_ontry.png" >
@adesignl
adesignl / foxboro_print_Styles.css
Created May 7, 2013 18:39
Hubspot Foxboro Print Styles
/* print styles for Foxboro theme */
body {
background: white;
font-size: 12pt;
}
#foxboro_container {
width: auto;
margin: 0 5%;
padding: 0;
@adesignl
adesignl / pricing-tables.css
Created April 26, 2013 13:44
Flexible pricing tables
/*----------
Blocks
----------*/
/*Pricing table and price blocks*/
.pricing_table {
line-height: 150%;
font-size: 12px;
margin: 0 auto;
width: 75%;
max-width: 800px;
@adesignl
adesignl / tabs.css
Created April 22, 2013 19:24
Simple Tabs
/* Tabs
------------------------------------------------------------- */
#tabContaier ul {
overflow: hidden;
background: #f5f5f5;
/*Clearing float. */
border-bottom: 1px solid #aaa;
height: 35px;
/*Takings tabs to higher layer */
z-index: 100;
@adesignl
adesignl / twitter_init.js
Last active December 16, 2015 06:08
Twitter Feed Javascript
<a class="twitter-timeline" data-dnt="true" href="https://twitter.com/[USER NAME HERE]" data-widget-id="344825471810273280" data-chrome="nofooter transparent noscrollbar noborders" >Tweets by @[USER NAME HERE]</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
@adesignl
adesignl / emptyelements.js
Created April 15, 2013 15:58
Remove all Elements that are empty
var optionsEmpty = ' h1, h2, h3, h4, h5, h6 '; // Change these according to your needs
$(optionsEmpty).each(function() {
var $this = $(this);
if($this.html().replace(/\s|&nbsp;/g, '').length == 0){ // May could beter this later but works in most curcumstances
$this.remove();
}
});