Skip to content

Instantly share code, notes, and snippets.

View thegreekjester's full-sized avatar
💭
hackin' away

Peter Katsos thegreekjester

💭
hackin' away
  • Syft AI
  • Austin, TX
View GitHub Profile
@thegreekjester
thegreekjester / FS_Optimizely.js
Created November 5, 2021 18:03
Fullstory_integration_edge
var waitUntil = function(callback) {
if (typeof callback === 'function') {
return new Promise(function(resolve, reject) {
var tick = setInterval(function() {
if (callback() === true) {
clearInterval(tick);
return resolve();
}
});
});
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
import pyspark
from itertools import product
experiment_list = ['20389491581']
output_dir = os.getcwd() + 'some path'
@thegreekjester
thegreekjester / cross_TLD_link_decoration.js
Created September 23, 2021 20:10
Link Decoration for Optimizely Web
@thegreekjester
thegreekjester / bucketing_script.js
Last active September 17, 2021 18:52
Bucketing script given input CSV
/*
Install required libraries:
- yargs (CLI)
- fast-csv (csv parser and writer)
- @optimizely/optimizely-sdk (optimizely SDK)
The following script takes in the following CLI arguments:
sdkKey (str): SDK Key of Optimizely datafile you wish to use
csv_file_path (str): The input CSV relative path with the following columns --> "User Identifier", "Bucketing ID",
import { logger as logger$1 } from 'log';
import { httpRequest } from 'http-request';
import 'create-response';
import { Cookies } from 'cookies';
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function unwrapExports (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
{
"name": "hello_world_test",
"author": "",
"license": "Apache-2.0",
"version": "2.0.0",
"description": "Example hello world test",
"main": "index.js",
"scripts": {
"build-webpack": "webpack && npm run build-zip",
"build-rollup": "rollup -c && tar -czvf ../ew.tgz -C dist bundle.json main.js",
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import copy from 'rollup-plugin-copy-assets';
import json from 'rollup-plugin-json';
export default {
// Specify main file for EdgeWorker
input: 'index.js',
// Define external modules, which will be provided by the EdgeWorker platform
external: ['cookies', 'http-request', 'log', 'create-response'],
@thegreekjester
thegreekjester / brother_extension
Created June 24, 2019 17:52
Extension for exit intent
{
"plugin_type": "widget",
"name": "Exit Modal",
"edit_page_url": "https://www.brother-usa.com/products/mfcj995dw",
"form_schema": [
{
"default_value": "Thanks for visiting Brother!",
"field_type": "text",
"name": "headline1",
"label": "Headline 1",
@thegreekjester
thegreekjester / iframe_clicks.js
Last active March 14, 2019 17:18
Iframe Optimizely Click Tracker
//This tracks clicks to Iframes
window.inIframe = false;
//Basically the next two event listeners turn this "inIframe" variable from false to true if they are within
//the bounds of the iframe by using mouseenter/mouseleave
document.querySelector('selector_here').addEventListener('mouseenter', function(){
inIframe = !inIframe
})
document.querySelector('selector_here').addEventListener('mouseleave', function(){
var templatePayload = {
"account_id": 'account123',
"visitors": [{
"visitor_id": null,
"attributes": {},
"snapshots": [{
"decisions": [],
"events": []
/*
https://developers.optimizely.com/x/events/api/index.html