Skip to content

Instantly share code, notes, and snippets.

Flask Tutorial
------------------------
**Dev Setup**
1) Install iTerm2 on your mac
2) Open up iTerm, and check your python version (should be 2.7) by typing
`python -V`
3) Install pip with `sudo easy_install pip`
@jwebgordon
jwebgordon / clickTrackEvents.js
Created May 14, 2013 15:10
Custom JS to add click track event listeners to all elements of a particular class This should be added to the Custom Javascript in Hubspot Events
var all_buttons = $('.buttons');
for(var i=0; i<all_buttons.length; i++){
_hsq.push(["trackClick", "#"+all_buttons.eq(i).attr('id'), "test2"+all_buttons.eq(i).attr('id')]);
}
@jwebgordon
jwebgordon / redirectMainWindow.js
Created February 6, 2013 18:47
Redirect the main window of the iframed form
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
function openParentWindow(){
if($("form.hs-form").length>0){
$("form.hs-form").attr('target','_top');
}
else{
setTimeout(openParentWindow,50);
}
@jwebgordon
jwebgordon / hubspot.css
Created December 27, 2012 16:01
HS style guide
@charset "UTF-8";
html, body {
margin: 0;
padding: 0
}
h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, cite, code, del, dfn, em, img, q, s, samp, small, strike, strong, sub, sup, tt, var, dd, dl, dt, li, ol, ul, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
font-weight: normal;
@jwebgordon
jwebgordon / dupeCleaner
Created December 14, 2012 20:52
dupe cleaner
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package hsutils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
@jwebgordon
jwebgordon / countryJS
Created December 14, 2012 14:03
JS to show state field when country = USA
<script type="text/javascript">
$(window).load(function(){
$('select[name="country_hubspot__c"]').change(function(){
if($('select[name="country_hubspot__c"]').val() == 'United States'){
$('div.hs_state_field__c').show();
}
else{
$('div.hs_state_field__c').hide();
}
@jwebgordon
jwebgordon / dropdownBean
Last active October 14, 2015 00:28
dropdownBean
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
@jwebgordon
jwebgordon / dropdownHTML
Last active October 14, 2015 00:28
dropdownHTML
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<title>Update Country and State Properties</title>
<link rel="stylesheet" type="text/css" href="css/hubspot.css" />
<link rel="stylesheet" type="text/css" href="css/main.css" />
</h:head>