Skip to content

Instantly share code, notes, and snippets.

View longjasonm's full-sized avatar

Jason Long longjasonm

View GitHub Profile
@longjasonm
longjasonm / rawjson.js
Created November 13, 2019 21:28
Add the raw JSON to the end of your Postman Visualizer template.
let template = `
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js?autoload=true&amp;skin=sunburst&amp;lang=js" defer></script>
<!-- Your content goes here -->
<hr>
<h1>Raw JSON Response</h1>
<pre class="prettyprint">{{raw}}</pre>
</div>
`
pm.visualizer.set(template, {
<!-- Button : Begin -->
<table cellspacing="0" cellpadding="0" border="0" class="center-on-narrow" style="float:left;">
<tr>
<td style="border-radius: 3px; background: #222222; text-align: center;" class="button-td">
<a href="http://www.google.com" style="background: #222222; border: 15px solid #222222; padding: 0 10px;color: #ffffff; font-family: sans-serif; font-size: 13px; line-height: 1.1; text-align: center; text-decoration: none; display: block; border-radius: 3px; font-weight: bold;" class="button-a">
<!--[if mso]>&nbsp;&nbsp;&nbsp;&nbsp;<![endif]--><span style="color:#ffffff">A Button</span><!--[if mso]>&nbsp;&nbsp;&nbsp;&nbsp;<![endif]-->
</a>
</td>
</tr>
</table>
<script type="text/javascript">
$.noConflict();
jQuery(document).ready(function($) {
$('.mktoStartEndTime').css('color','#fff');
$('.mktoRules a').css('color','#fff');
});
</script>
@longjasonm
longjasonm / gist:7772888
Created December 3, 2013 16:59
Cool calendar HTML for emails -- derived from MailChimp.
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100" style="background-color:#FFFFFF; border:1px solid #CCCCCC;">
<tr>
<td align="left" valign="top" style="padding:5px;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top" style="background-color:#BB0000; color:#FFFFFF; font-family:Helvetica, Arial, sans-serif; font-size:14px; font-weight:bold; padding-top:5px; padding-bottom:5px; text-align:center;">
January
</td>
</tr>
<tr>
@longjasonm
longjasonm / checkbox-validate.js
Created November 12, 2013 17:56
Validate a Marketo Terms and Conditions (or any other) Checkbox
//Add the ID of your Marketo Form
$('#mktForm_1030').attr('onSubmit','return validate_form ( );');
//Add the "name" properties of your form and field. i.e. mktForm_1030, CustomField_Terms_of_Service)
function validate_form ( )
{
valid = true;
@longjasonm
longjasonm / gist:6555757
Created September 13, 2013 20:38
Update the intro text on the Marketo Social Sign-In box.
<script type="text/javascript">
// Add this code in a "HTML" block in the Marketo Landing Page Editor.
// Use jQuery.noConflict just in case.
if ( typeof $jQ == 'undefined' ) { var $jQ = jQuery.noConflict(); }
//Replace 'Register with:" with your desired text.
$jQ(document).ready(function() {
$jQ('.cf_sign_on_caption').html('Register with:');
})
@longjasonm
longjasonm / gist:6529893
Created September 11, 2013 21:15
Make all links on a page "nofollow".
<script type="text/javascript">
if ( typeof $jQ == 'undefined' ) { var $jQ = jQuery.noConflict(); }
$jQ(document).ready(function() {
$jQ('a').attr('rel', 'nofollow');
})
</script>
@longjasonm
longjasonm / functions.php
Last active November 6, 2019 00:40
How to set up a 4-column footer in the Genesis framework. I've only seen code about 3-column setups, but I need 4 for a design I'm working on. Here's my code.
<?php
//* Do NOT include the opening php tag
// Add support for 4-column footer widgets
add_theme_support( 'genesis-footer-widgets', 4 );
@longjasonm
longjasonm / gist:5334717
Last active December 15, 2015 22:39
Change Submit Button text on a Marketo Landing Page Form
<script type="text/javascript">
// Add this code in a "HTML" block in the Marketo Landing Page Editor.
// Use jQuery.noConflict just in case.
if ( typeof $jQ == 'undefined' ) { var $jQ = jQuery.noConflict(); }
// Declare your Submit Button Text; example: .val('Register for Webinar')
$jQ(document).ready(function() {
$jQ('#mktFrmSubmit').val('... your text here...');
})
@longjasonm
longjasonm / gist:5033215
Created February 25, 2013 20:56
Show/hide fields dynamically on Marketo forms.
<script type="text/javascript">
var $jQ = jQuery.noConflict();
$jQ(document).ready(function(){
//This code shows a field with ID = "State" when the value of field ID = "Country" is "Australia".
//Add this code to an HTML block on the landing page.
// Put the ID of the dynamic field here
var stateRow = $jQ("#State").parents("li:first");
var stateField = $jQ("#State");