Skip to content

Instantly share code, notes, and snippets.

View gabemartinez's full-sized avatar

Gabriel Martinez gabemartinez

View GitHub Profile
@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,
<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 / 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/).
@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 / 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);