Skip to content

Instantly share code, notes, and snippets.

View aaronchi's full-sized avatar

Aaron Eisenberger aaronchi

  • Santa Monica, CA
View GitHub Profile
@aaronchi
aaronchi / gist:9359599
Created March 5, 2014 01:41
Box SAML debugging
<samlp:AuthnRequest IssueInstant="2014-03-05T01:39:52.993Z"
ID="v2s9D7jwhXxeuo5pxOt4lBGZ54x"
Version="2.0"
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
>
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">box.net</saml:Issuer>
<samlp:NameIDPolicy AllowCreate="true" />
</samlp:AuthnRequest>
<samlp:Response ID="_0c0df300-8635-0131-7cd0-20c9d044e103"
@aaronchi
aaronchi / waitFor.js
Created June 9, 2014 19:16
waitFor without deffered
(function ($) {
'use strict';
$.fn.waitFor = function (options) {
options = options || {}; // Note: all arguments default
options.timeout = options.timeout || 100; // Note: default timeout
var el;
var selector = this.selector;
function waitForElement(timeout) {
var $elements = $(selector);
@aaronchi
aaronchi / gist:6ce34f208e2fe25209b4
Created July 11, 2014 17:59
Intaact XML schema -> YAML
schemas:
users:
attributes:
- name: request
attributes:
- name: control
attributes:
- name: senderid
value: $account_login
- name: password
<?xml version="1.0" encoding="UTF-8"?>
<xmlrequest>
<request>
<control>
<senderid>Bitium</senderid>
<password>5V4da3RkhB</password>
<controlid>bitium</controlid>
<uniqueid>false</uniqueid>
<dtdversion>2.1</dtdversion>
</control>
require 'omniauth-oauth2'
module OmniAuth
module Strategies
class Smartsheet < OmniAuth::Strategies::OAuth2
# Give your strategy a name.
option :name, "smartsheet"
# This is where you pass the options you would pass when
# initializing your consumer from the OAuth gem.
---
name: Webex
base_url: https://meetings.webex.com
login_type: email
authentication_types:
- browser
launch_timeout: 60
spider:
driver: webkit
actions:
@aaronchi
aaronchi / gist:4a1a2db3a994c8a95168
Last active August 29, 2015 14:04
webex enterprise
---
name: Webex Enterprise
base_url: https://{subdomain}.webex.com/
login_type: username
installation:
fields:
- name: subdomain
notes: within_frame not working reliably with webkit and frameset
spider:
driver: poltergeist
<samlp:AuthnRequest
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="_ca41734ef91362577eb1" Version="2.0" IssueInstant="2014-11-03T22:44:43Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="http://bitium-sugarcrm.keewooi.com/index.php?module=Users&action=Authenticate">
<saml:Issuer
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">php-saml
</saml:Issuer>
<samlp:NameIDPolicy
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" AllowCreate="true">
</samlp:NameIDPolicy>
<samlp:RequestedAuthnContext
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" Comparison="exact">
---
name: Google Calendar
group: google-apps
base_url: https://www.google.com/calendar
allowed_hosts:
- google.com
- accounts.google.com
requires_plugin: true
validation_method: script
login_type: email
# Extends Array class with a new flatten method
# Type checking is not done since this is extending Array
# Uses simple recursion
class Array
def re_flatten
flat = []
self.each do |a|
if a.is_a?(Array)