Skip to content

Instantly share code, notes, and snippets.

View asaschachar's full-sized avatar

Asa Schachar asaschachar

View GitHub Profile

Keybase proof

I hereby claim:

  • I am asaschachar on github.
  • I am asa_optimizely (https://keybase.io/asa_optimizely) on keybase.
  • I have a public key whose fingerprint is E1F3 310F 4D15 4ED2 649F 53D3 B118 4CD8 D605 7DE7

To claim this, I am signing this object:

@asaschachar
asaschachar / generate_fullstack_mvt.py
Last active October 17, 2017 16:29 — forked from jo-migo/generate_fullstack_mvt.py
Script to Generate a Generic Fullstack MVT
import json
import os
import pprint
import requests
import sys
'''
DIRECTIONS:
- Create a feature flag in the UI, add feature variables with default values
@asaschachar
asaschachar / setup_script.bash
Last active October 17, 2017 16:29 — forked from jo-migo/setup_script.bash
Setup Script for Fullstack MVT Generator
#!/bin/bash
# If you don't have trailmix installed, you have to run `sudo pip install -i https://localshop.dz.optimizely.com/simple/ --upgrade --ignore-installed trailmix` first!!
export PISTACHIO_PATH=dev
export PISTACHIO_BUCKET=optimizely-pci-pistachio
eval $(trailmix --escape-quotes -f exports frontdoor)
export PROXY_SHARED_SECRET=$THREESCALE_SHARED_SECRET
@asaschachar
asaschachar / project_javascript
Last active September 3, 2022 13:21
Project JavaScript
if (isComplex) {
for (var i=6, j='crazy'; i<isComplex.length; i+=3) {
while(j.length < 20) {
j = j.concat('hello');
switch (i % 2) {
case 0:
j = j.concat('U');
break;
case 1:
break;
@asaschachar
asaschachar / project_javascript
Created July 20, 2018 01:26
Project JavaScript
if (isComplex) {
for (var i=6, j='crazy'; i<isComplex.length; i+=3) {
while(j.length < 20) {
j = j.concat('hello');
switch (i % 2) {
case 0:
j = j.concat('U');
break;
case 1:
j = j.concat('U');
@asaschachar
asaschachar / project_javascript
Created July 20, 2018 01:31
Project JavaScript
if (isComplex) {
for (var i=6, j='crazy'; i<isComplex.length; i+=3) {
while(j.length < 20) {
j = j.concat('hello');
switch (i % 2) {
case 0:
j = j.concat('U');
break;
case 1:
j = j.concat('U');
@asaschachar
asaschachar / project_javascript
Created July 20, 2018 01:32
Project JavaScript
if (isComplex) {
for (var i=6, j='crazy'; i<isComplex.length; i+=3) {
while(j.length < 20) {
j = j.concat('hello');
switch (i % 2) {
case 0:
j = j.concat('U');
break;
case 1:
j = j.concat('U');
// Requires node v7.6 or greater
// npm install --save @optimizely/optimizely-sdk request request-promise
const optimizely = require('@optimizely/optimizely-sdk');
const request = require('request-promise');
// The datafile url for your project & environment
const DATAFILE_URL = 'https://cdn.optimizely.com/datafiles/QMVJcUKEJZFg8pQ2jhAybK.json';
const user = {
id: 'user123',
/**
* Optimizely Node Datafile Manager
*
*
* USAGE - INSTALLATION
* // Pre-requisites: npm install --save request-promise request @optimizely/optimizely-sdk
* // Save this file in a file named optimizely-manager.js
* const createOptimizelyManager = require('./optimizely-manager')
* const optimizelyManager = createOptimizelyManager('Ly8FQj6vSaDcZUjySoWnWz')
*

Wrapper - Rollouts SDK

import OptimizelyManager from '@optimizely/optimizely-rollouts-sdk';
OptimizelyManager.configure({
  sdkKey: 'Ly8FQj6vSaDcZUjySoWnWz'
})

const optimizely = OptimizelyManager.getClient();
const enabled = optimizely.isFeatureEnabled('sale_price');