Skip to content

Instantly share code, notes, and snippets.

View tylergaw's full-sized avatar

Tyler Gaw tylergaw

View GitHub Profile

Groundwork.JS Usage Guide

Overview

Groundwork.js is a small library to assist developer when working with The Groundwork platform. It provides a consistent interface to our APIs and handles the intricacies of authentication for you.

Groundwork.js is specifically for use in the browser. You can load it directly from our CDN as a <script> tag or import it into your application via a UMD interface.

Examples

Replace YOURCODEHERE with your code:
http://www.ticketweb.com/t3/sale/SaleEventDetailSubmit?dispatch=proceed&eventId=6580715&pl=webconcerts&view=list&promoCode=YOURCODEHERE&org.apache.struts.taglib.html.CANCEL=Apply+Access+Code
@tylergaw
tylergaw / gist:fc0ee6733a771e6ef568
Last active August 29, 2015 14:24
Boolean attributes halp
@tylergaw
tylergaw / gist:a00633db11fafaec88ce
Created June 12, 2015 16:47
Create an OS X App from a single javascript file

Dong some learnin' about the osacompile command for using JS to write OS X apps/applets/automations etc. If you're on Yosemite (or greater):

Safari CORs

This example works in Chrome and Firefox but will fail in Safari http://jsfiddle.net/9qxs5gdf/

Safari sends the origin header along with the first OPTIONS request. I'm wondering if the Dribbble API does not allow that header?

From Safari: Access-Control-Request-Headers accept, authorization, origin

Saw a similar issue here:

@tylergaw
tylergaw / Jribbble Shots Example 001.markdown
Created May 18, 2015 02:26
Jribbble Shots Example 001
@tylergaw
tylergaw / gist:310329da6173d215c8a0
Created April 26, 2015 20:34
Dribbble API CORs request standard XMLHttpRequest vs. jQuery $.ajax

I'm attempting to make CORs requests to the Dribbble API v1. I can do so using a standard XMLHttpRequest, but cannot using jQuery's $.ajax.

I'm trying to determine if I'm just doing something wrong with the jQuery request, if jQuery is doing something wrong, or if the Dribbble server is missing some bit of CORs configuration.

Here is a working example showing two different CORs requests: http://jsfiddle.net/thegaw/pec38u18/

One thing that is sticking out to me is that the jQuery request is setting the following header:

Access-Control-Request-Headers:accept, authorization
#!/bin/sh
git rev-parse 2>/dev/null
if [[ $? != 0 ]]
then
echo "Not a git repo"
return
fi
@tylergaw
tylergaw / gist:cd1f28f60a838c24aef8
Last active August 29, 2015 14:10
ember-cli generate controller with type option

I was trying to use nodegit and was running into trouble. I followed the install instructions on the README and then tried the examples there, but was getting errors for anything beyond requiring the package.

For now it seems you can't use the version of nodegit that is published to npm.

npm install nodegit

That will install version 0.1.4. Which seems to not work. Here's an example of what would happen.