Skip to content

Instantly share code, notes, and snippets.

View Saabbir's full-sized avatar

Saabbir Hossain Saabbir

View GitHub Profile
@Saabbir
Saabbir / optimizely-x-js-api.js
Created June 4, 2024 10:50 — forked from jamesspittal/optimizely-x-js-api.js
JS API calls for Optimizely X
// Top-level functions
window.optimizely.get('state');
window.optimizely.get('data');
window.optimizely.get('visitor'); // For custom attributes and such
window.optimizely.get('behavior'); // For behavior queries
// Common examples
window.optimizely.get('state').getActiveExperimentIds(); // Returns an array of active experiment IDs on a page.
window.optimizely.get('data').revision; // Returns the revision that the snippet on the page is on. Useful in determining whether you are looking at the most updated changes made within a campaign.
window.optimizely.get('state').getVariationMap(); // Returns an object of experiment IDs and the corresponding variation ID a user has been bucketed into. Equivalent of classic Optimizely Testing's optimizelyBuckets cookie (which is no longer available within Optimizely X Web).
@Saabbir
Saabbir / hyper.js
Created November 15, 2023 20:22 — forked from coco-napky/hyper.js
Hyper config for git bash in Windows
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',