Skip to content

Instantly share code, notes, and snippets.

View gabemartinez's full-sized avatar

Gabriel Martinez gabemartinez

View GitHub Profile
@gabemartinez
gabemartinez / pulllwithselectors.js
Last active November 11, 2015 21:30
Pulling IDs and Custom Attribute Values Based on Selector, then looping and setting css after DOM is ready - jQuery
(function($){
$(document).ready(function(){
//setting class for all full bg image co paragraphs
$('.full-background-image-callout').parent().parent().parent().parent().parent().parent().parent().parent().parent().addClass('full-background-image-callout-background');
//total amount of full bg image co paragraphs in this document
var amountoffullbackgroundparagraphs = $('.full-background-image-callout-background').length;
console.log(amountoffullbackgroundparagraphs);
@gabemartinez
gabemartinez / setdivbackgroundjquery.js
Created November 20, 2015 16:12
Setting div background image via jQuery.
(function($){
$(document).ready(function(){
//setting class for all full bg image co paragraphs
$(".full-background-image-callout").parent().parent().parent().parent().parent().parent().parent().addClass("full-background-image-callout-background");
$(".two-column-photos").parent().parent().parent().parent().parent().parent().parent().addClass("two-column-photos-full-background");
/*--*/
@gabemartinez
gabemartinez / screenshot2.js
Last active July 13, 2016 23:04
PhantomJS screenshots, multiple widths.
var URLS = ["https://test-clas3.ws.asu.edu/",
"https://dev-clas3.ws.asu.edu/",
"https://live-clas3.ws.asu.edu/"
];
var SCREENSHOT_WIDTH = 1280;
/*!
*
* Automatic Responsive screenshots creation with PhantomJS and CasperJS.
* Adapted from the Responsive Design Workflow book by Stephen Hay (http://responsivedesignworkflow.com/).
<p><img src="https://asuclas.qualtrics.com/CP/Graphic.php?IM=IM_d6J1NYBogMXsp13" style="width: 320px; height: 43px;" /></p>
<hr style=" display: block;
height: 1px;
border: 0;
border-top: 4px solid #000;
margin: 1em 0;
padding: 0; " />MEMORANDUM<br />
To: Voting Members of the College of Liberal Arts and Sciences<br />
From: Dean Kenney<br />
@gabemartinez
gabemartinez / Parsing_Error_Codes_JavaScript.html
Created September 15, 2016 16:34
Drupal Web Collect Error Page
<script type="text/javascript">
//jQuery
jQuery(document).ready(function($) {
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
<script type="text/javascript">
<!--
// isEmail (STRING s [, BOOLEAN emptyOK])
// whitespace characters
var whitespace = " \t\n\r";
//
// Email address must be of form a@b.c ... in other words:
// * there must be at least one character before the @
<form action="http://cl.exct.net/subscribe.aspx" name="subscribeForm" method="post">
<input type="hidden" name="thx" value="https://sfmctest-clas3.ws.asu.edu/content/test-web-collect-success" />
<input type="hidden" name="err" value="https://sfmctest-clas3.ws.asu.edu/content/test-web-collect-error" />
<input type="hidden" name="usub" value="https://sfmctest-clas3.ws.asu.edu/content/test-web-collect-success" />
<input type="hidden" name="MID" value="7201485" />
<input name="ASU College of Liberal Arts and Sciences" type="hidden" value="TRUE" />
<div class="form-group">
<label for="firstNameInput">First Name</label>
<input class="form-control" id="firstNameInput" placeholder="First Name" name="First Name">
<form action="http://cl.exct.net/DEManager.aspx" name="subscribeForm" method="post">
<input type="hidden" name="_clientID" value="7204971" />
<input type="hidden" name="_deExternalKey" value="C84C694E-5FE6-416B-A0B7-AF59A6C54211" />
<input type="hidden" name="_action" value="add" />
<input type="hidden" name="_returnXML" value="0" />
<input type="hidden" name="_successURL" value="https://sfmctest-clas3.ws.asu.edu/content/test-web-collect-success" />
<input type="hidden" name="_errorURL" value="https://sfmctest-clas3.ws.asu.edu/content/test-web-collect-error" />
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<!-- Inliner Build Version 4380b7741bb759d6cb997545f3add21ad48f010b -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
</head>
<body style="width: 100% !important; min-width: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; color: #222222; font-family: 'Helvetica', 'Arial', sans-serif; font-weight: normal; text-align: left; line-height: 19px; font-size: 14px; margin: 0; padding: 0;"><style type="text/css">
a:hover {
color: #8C0B43 !important;