Skip to content

Instantly share code, notes, and snippets.

// SECRETS!! ACTUAL VALUES SHOULD BE OMMITTED FROM GIST
var ACCOUNT_PASSWORD = 'SECRET';
var ACCOUNT_API_TOKEN = 'SECRET';
/**
* Gist link: https://gist.github.com/circAssimilate/31d7ea6a24a22532b50fcd2b6af2ffb3
*
* OWNERS:
* - derek@optimizely.com
* - siddhartha.kakarla@optimizely.com
@circAssimilate
circAssimilate / sort_by_immutable_key.js
Created November 14, 2017 00:00
Sort by Immutable JS Key
/**
* sortByImmutableKey: sort given an Immutable List, key, and ascending/descending
*
*
* @param immutableList(Immutable.List)
* @param sortKey(string)
* @param ascending(boolean)
*/
export const sortByImmutableKey(immutableList, sortKey, ascending=false) {
if (__DEV__ && typeof immutableList === 'undefined') {
@circAssimilate
circAssimilate / pollForDelayedContent_v2.js
Last active October 14, 2016 22:28
The pollForDelayedContent() v2 helper function (with Truthy option) is an alternative solution to some of the approaches listed here: https://help.optimizely.com/hc/en-us/articles/200457495. Look below for more info.
/*
* OPTIMIZELY POLL FOR DELAYED CONTENT v2 (with Truthy option):
*
* The pollForDelayedContent() helper function is an alternative solution to some of the approaches listed here: https://help.optimizely.com/hc/en-us/articles/200457495.
* It will be able to be used as many times as it's needed within an experiment or variation. When the Optimizely snippet is implemented correctly, it should provide a way to eliminate all content flashing.
* The function allows for a an "options" element, to allow for more flexibility as well.
* Feel free to file a ticket at optimizely.com/support with any feedback or questions - as the comments on this page will not be responded to.
*
* SIMPLE USAGE EXAMPLE: this does not use the optional options object to specify selectorToHide, timeoutInSeconds, or intervalInMilliseconds, causing them to default to hide the no timeout and 50 milliseconds.
*
@circAssimilate
circAssimilate / Optimizely Poll For Delayed Content
Last active February 29, 2016 19:10
The pollForDelayedContent() helper function is an alternative solution to some of the approaches listed here: https://help.optimizely.com/hc/en-us/articles/200457495. Look below for more info.
/**
* OPTIMIZELY POLL FOR DELAYED CONTENT:
*
* The pollForDelayedContent() helper function is an alternative solution to some of the approaches listed here: https://help.optimizely.com/hc/en-us/articles/200457495.
* It will be able to be used as many times as it's needed within an experiment or variation. When the Optimizely snippet is implemented correctly, it should provide a way to eliminate all content flashing.
* The function allows for a an "options" element, to allow for more flexibility as well.
* Feel free to file a ticket at optimizely.com/support with any feedback or questions - as the comments on this page will not be responded to.
*
* SIMPLE USAGE EXAMPLE: this does not use the optional options object to specify selectorToHide, timeoutInSeconds, or intervalInMilliseconds, causing them to default to hide the no timeout and 50 milliseconds.
*