Skip to content

Instantly share code, notes, and snippets.

View jcoryalvernaz's full-sized avatar
🕹️

Cory Alvernaz jcoryalvernaz

🕹️
View GitHub Profile
// Get the name of the Parsely visitor cookie
const parselyVisitorCookieName = window.PARSELY.visitorManager.visitorCookieName || '_parsely_visitor';
// Get the visitor object from the Parsely cookie
const parselyVisitor = window.PARSELY.ParselyStorage.getJSON(parselyVisitorCookieName);
// Construct hidden fields to pass to the Pardot iframe
// The `parentUrl` will be the URL in which the iframe is embedded
// The `conversionType` and `conversionLabel` should be set per the Parsely docs: https://www.parse.ly/help/integration/conversions-self-managed-integration#conversion-types
const hiddenFieldsObject = {
<script type="text/javascript">
//<![CDATA[
setTimeout(function() {
// Get the name for the Parsely visitor cookie
const parselyVisitorCookieName = PARSELY.visitorManager.visitorCookieName || '_parsely_visitor';
// Construct the visitor object with hidden fields passed to the form
const parselyVisitor = {
id: "%%parsely_visitor_id{js}%%",
session_count: parseInt("%%parsely_visitor_session_count{js}%%", 10),
/*mixin declaration example*/
@mixin padding($values...) {
@each $var in $values {
padding: #{$var};
}
}
/*stylize typeahead.js http://twitter.github.io/typeahead.js/css/examples.css */
.tt-menu {
background-color: #fff;
/*stylize typeahead.js http://twitter.github.io/typeahead.js/css/examples.css */
.tt-menu
{
background-color: #fff;
border: 1px solid #ccc;
border-radius: 4px;
margin-top: 1px;
max-height: 150px;
overflow-y: auto;
width: 300px;
const API_KEY = [Enter API Key Here];
const searchStockAPI = 'https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=';
const matchStockAPI = 'https://www.alphavantage.co/query?function=SYMBOL_SEARCH&keywords=';
$(document).ready(function() {
//Configure typeahead reference https://github.com/twitter/typeahead.js/blob/master/doc/jquery_typeahead.md#options
<!DOCTYPE html>
<html>
<head>
<title>Search Stock</title>
<meta charset="utf-8"/>
<!--Bootstrap stylesheet-->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<!--App stylesheet-->
<link href="./main.css" rel="stylesheet"/>
<!--JQuery Library-->
const API_KEY = '[Enter API Key Here]';
const alphavantageAPI = 'https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=';
function searchStock() {
let table = document.querySelector('#output');
let message = document.querySelector('#message');
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script type="text/javascript" src="./main.js"></script>
</head>
<body>
<div class="container p-5">
function searchBooks() {
//Get user inputs
let bookTitle = document.querySelector('#bookTitle');
let maxResults = document.querySelector('#maxResults');
//Get reference to empty table for JSON output
let tblOutputJSON = document.querySelector('#tblOutputJSON');
//Clear out table in case of resubmit
<!DOCTYPE html>
<html>
<head>
<title>Search Books</title>
<meta charset="utf-8" />
<!--documentation for Bootstrap at https://getbootstrap.com/docs/4.0/getting-started/introduction/-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!--External stylesheet-->
<link rel="stylesheet" href="./main.css" />