Skip to content

Instantly share code, notes, and snippets.

@aroach
aroach / ABTestService.service.js
Created January 5, 2016 23:09
angular-optimizely
angular.module('myApp')
.service('ABTestService', function () {
this.abtestActivateExperiment = function(experimentId) {
console.log(experimentId);
window['optimizely'] = window['optimizely'] || [];
window.optimizely.push(["activate", experimentId]);
console.log(window['optimizely'].variations);
var variation = window.optimizely.variationMap;
@aroach
aroach / gist:738b904b824bd144ad1bc7ae937c73a9
Last active October 7, 2018 20:18
Intro to Containers in the style of Dr. Seuss
Note: I created this for Cisco Live San Diego 2015.
My name is Ashley.
I am the explainer,
In the next 10 mins,
We talk containers
Chapter 1: The situation
Let’s meet a web app
@aroach
aroach / keybase.md
Created April 12, 2017 16:04
keybase proof

Keybase proof

I hereby claim:

  • I am aroach on github.
  • I am ashleyroach (https://keybase.io/ashleyroach) on keybase.
  • I have a public key ASDc2lv9E3kjDITnYLnxRka9xXfsfb0EpK3lstFdGEyWMgo

To claim this, I am signing this object:

@aroach
aroach / function1.js
Created April 24, 2017 22:31
Example functions
'use strict'
var https = require('https');
exports.handler = (context, callback) => {
// Add your code here
request(
{
url: 'https://api.github.com/users/aroach/gists',
headers: {
'accept': 'application/json',
@aroach
aroach / apic-em-function.js
Created April 28, 2017 17:58
APIC-EM example
'use strict'
var util = require('util');
exports.handler = (context, callback) => {
// Add your code here
var body = JSON.stringify({
'username': 'devnetuser',
'password': 'Cisco123!',
})
#!/usr/bin/env bash
# Usage:
# To run from workstation: bash -c "$(curl -fsSL <url>)"
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
# echo "${red}red text ${green}green text${reset}"
@aroach
aroach / app.js
Created February 21, 2019 20:51
twilio-sg-example
require('dotenv').config()
var Twilio = require('twilio');
var sgMail = require('@sendgrid/mail');
var accountSid = process.env.TWILIO_SID;
var authToken = process.env.TWILIO_AUTH_TOKEN;
var client = new Twilio(accountSid, authToken);
sgMail.setApiKey(process.env.SENDGRID_API_KEY);