Skip to content

Instantly share code, notes, and snippets.

View acbrent25's full-sized avatar

Adam Champagne acbrent25

View GitHub Profile
@acbrent25
acbrent25 / add-active-class.js
Last active October 23, 2019 17:19
Add Active Class to Current Page #navigation
// Get Full URL
var href = window.location.href;
// Get everything before last '/'
var baseUrl = href.substr(0, href.lastIndexOf('/'));
// Get everything after last '/'
var currentPage = href.substr(href.lastIndexOf('/') + 1);
// Add Class active to the link if on current page
@acbrent25
acbrent25 / select-validation-messaging.html
Created October 26, 2018 15:06
Custom Validation Messaging for Form Selects with Bootstrap and jQuery
<form action="/" method="post" enctype="multipart/form-data">
<div class="form-group">
<label for="select_validation">Select Validation: *</label>
<select class="form-control" name="select_validation" id="select_validation">
<option value="">Make Selection</option>
<option value="selectOne">selectOne</option>
<option value="selectTwo">selectTwo</option>
<option value="selectThree">selectThree</option>
</select>
</div>
@acbrent25
acbrent25 / select-link-change.html
Created October 4, 2018 19:59
Link to another page on select option change using jQuery
@acbrent25
acbrent25 / scroll-to-top-button.css
Created July 21, 2018 15:51
Website Scroll to Top Button
#scrollTopBtn {
display: none;
position: fixed;
bottom: 0px;
right: 10px;
z-index: 99;
border: none;
outline: none;
color: #303030;
cursor: pointer;
@acbrent25
acbrent25 / terminal.txt
Created March 19, 2018 18:39
[Mac Terminal Commands] Grep commands to search anything #grep
Text in subfolders -r grep -r Walden ~/Documents/*
Finds Walden in any file in any subfolder of ~/Documents.
Whole words only -w grep -w live
Finds only live ; does not find liver , lives , lived , and so on.
Case-insensitive text -i grep -i pond
Finds pond , POND , or Pond .
File names only -l grep -l Walden
Finds files containing Walden , but returns only a list of file names.
Number of occurrences only -c grep -c Walden
Returns the names of files containing Walden and the number of hits in each file.
@acbrent25
acbrent25 / vscode-snippets.txt
Last active March 12, 2018 19:07
[VS Code Set tab space] #vscode
// The number of spaces a tab is equal to. This setting is overriden
// based on the file contents when `editor.detectIndentation` is true.
"editor.tabSize": 4,
// Insert spaces when pressing Tab. This setting is overriden
// based on the file contents when `editor.detectIndentation` is true.
"editor.insertSpaces": true,
// When opening a file, `editor.tabSize` and `editor.insertSpaces`
// will be detected based on the file contents. Set to false to keep
@acbrent25
acbrent25 / responsive-email-2-column.html
Created December 22, 2017 20:40
[Email 2 Column Responsive Layout] Centers as screen gets smaller #email
<!-- 2 - COL Responsive : BEGIN -->
<tr>
<td valign="top" bgcolor="#eeeeee" class="cols-2" style="padding: 10px 30px 25px 30px; background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif;">
<!-- l-col -->
<table class="l-col" width="270" align="left">
<tr>
<td valign="top" width="100%" style="font-size: 14px; line-height: 16px; color: #222222; padding: 10px 10px 10px 10px">
<img class="center-on-narrow" alt="alt text here" src="http://via.placeholder.com/250x150">
<h3 class="center-on-narrow" style="font-size:16px;">Promo heading here</h3>
@acbrent25
acbrent25 / email-full-width-content-row.html
Last active December 22, 2017 21:17
[Email Full Width Content Row] #email
<!-- Full Width Content Row : BEGIN -->
<td valign="top" bgcolor="#ffffff" valign="top" class="content" style="padding: 0; font-family:Arial, Helvetica, sans-serif; font-size: 16px; line-height:22px; color: #222222;">
XOXO helvetica lumbersexual swag waistcoat schlitz. PBR&B actually cronut hexagon marfa hashtag, snackwave forage freegan gluten-free. Next level selvage bushwick chambray celiac palo santo glossier distillery iPhone asymmetrical farm-to-table pinterest XOXO gentrify. Fashion axe venmo church-key stumptown.
</td>
<!-- Full Width Content Row : END -->
@acbrent25
acbrent25 / email-responsive-hero-image.html
Created December 22, 2017 19:41
[Email Hero Image] Full Width Responive Hero Image #email
<!-- Hero Image, Flush : BEGIN -->
<tr>
<td bgcolor="#ffffff" align="center">
<img src="http://placehold.it/1200x600" width="600" height="" alt="alt_text" border="0" align="center" style="width: 100%; max-width: 600px; height: auto; background: #dddddd; font-family: sans-serif; font-size: 15px; line-height: 20px; color: #555555; margin: auto;" class="g-img">
</td>
</tr>
<!-- Hero Image, Flush : END -->
@acbrent25
acbrent25 / email-starter.html
Last active December 22, 2017 20:42
[Email Starter File] Lays Out Basic HTML Email Framework #email
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<meta charset="utf-8"> <!-- utf-8 works for most cases -->
<meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary -->
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine -->
<meta name="x-apple-disable-message-reformatting"> <!-- Disable auto-scale in iOS 10 Mail entirely -->
<title></title> <!-- The title tag shows in email notifications, like Android 4.4. -->
<!-- Web Font / @font-face : BEGIN -->