Skip to content

Instantly share code, notes, and snippets.

View Bigspencey's full-sized avatar

Spencer Smitherman Bigspencey

View GitHub Profile
{
"id": 2298738049164,
"created_at": "2020-06-26T18:54:13.000Z",
"updated_at": "2020-07-01T02:50:03.000Z",
"email": "customer@example.com",
"contact_email": "customer@example.com",
"name": "#74063",
"order_number": 74063,
"token": "9a9c8b70f5415544cd88cdf17df6fdad",
"tags": "returnly_repurchase, Riskified::approved, Riskified::submitted",
@Bigspencey
Bigspencey / shopify-order-exchange.json
Created August 5, 2020 23:23
Exchange order example
{
"id": 2298133479564,
"created_at": "2020-06-25T22:10:37.000Z",
"updated_at": "2020-07-01T02:50:01.000Z",
"email": "customer@example.com",
"contact_email": "customer@example.com",
"name": "#73941",
"order_number": 73941,
"token": "839a2c37d767ef5db6babb3b578ef920",
"tags": "returnly_exchange, Riskified::approved, Riskified::submitted",
@Bigspencey
Bigspencey / pre-fill-form.js
Created August 5, 2020 23:19
Pre-Fill the Returnly Landing page form via Query Parameters
if (window.location.search.indexOf("order_id") !== -1) {
var queryParams = new URLSearchParams(window.location.search);
$("input[name=order_id]").val(queryParams.get('order_id'));
$("input[name=shipping_zip]").val(queryParams.get('shipping_zip'));
}
//Unique Revenue Object
/* Pass an object like the one below into the OptimizelyRevenueTracker function object. The tracking call with revenue total will only be sent for the experiment IDs provided in the experimentIds array. If passed an order Id, it will only send one revenure tracking call for that particular order. This avoids duplicate revenue values when a visitor reloads the page where the revenue is being tracked.
*/
//Below is an example object to pass into the OptimizelyRevenueTracker
var opt = {
'experimentIds': ['123', '456', '789'], //array of experimentId strings
'eventName': "custom_event",
'revenueGetter': function() {
<script type="text/javascript">
function getOptimizelyTestMap(e) {
if ("undefined" != typeof window["optimizely"]) {
var allTests = window["optimizely"].allExperiments
, charCount = 0
, siteCatalyst = s_gi(s_account)
, variationMap = window["optimizely"].variationMap
, variationMapActive = [] // Leave behind only tests that are still running
;
<script>
(function() {
var projectId = [YOUR PROJECT ID];
var protocol = ('https:' == document.location.protocol ? 'https://' : 'http://');
var scriptTag = document.createElement('script');
scriptTag.type = 'text/javascript';
scriptTag.async = true;
scriptTag.src = protocol + 'cdn.optimizely.com/js/' + projectId + '.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(scriptTag, s);
@Bigspencey
Bigspencey / gist:ca74bc89fa446be0143a
Created March 6, 2015 22:44
Scroll Depth Custom Event Firing
// Variables to prevent continuous firing of custom events
var scrollTwentyFive = true;
var scrollFifty = true;
var scrollSeventyFive = true;
var scrollOneHundred = true;
// Create the scrollPercentage
$(window).bind('scroll', function() {
window.scrollPercent = ($(window).scrollTop() / ($(document).height()-$(window).height())) * 100;
@Bigspencey
Bigspencey / jquery_example.html
Last active January 1, 2016 06:29 — forked from dbc-challenges/jquery_example.html
Intro to jQuery for Phase 0
<!DOCTYPE html>
<html>
<head>
<title>DOM manipulation with jQuery</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery_example.js"></script>
</head>
<body>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title> Spencer Smitherman: Fun Extraordinaire</title>
<link rel="stylesheet" type="text/css" href="css/normalize.css" media="screen">
<link rel="stylesheet" type="text/css" href="project.css" media="screen">
</head>
<body>
<h1>Spencer W. Smitherman</h1>

Include an inline screenshot of your codeschool's points from the profile page:

QUIZ

Explain which tabs support the following actions and how.

Realtime editing of HTML and CSS Javascript Debugging Performance Optimization What's the quick key for your OS to spawn the Dev Tools inspector?