Skip to content

Instantly share code, notes, and snippets.

View eccegordo's full-sized avatar

Gordon Potter eccegordo

View GitHub Profile
@eccegordo
eccegordo / gist:6180740
Last active December 20, 2015 19:09
Controller with generic array and events
App.FoosController = Ember.ArrayController.extend({
myOptions: Ember.A([]),
addOptionItem: function(option) {
this.pushObject(option);
},
removeOptionItem: function(option) {
this.get('myOptions').forEach(function(item, i, myOptions) {
if (item.get('id') === option.get('id')) {
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="An example of working through the ember nest routes" />
<script src="http://code.jquery.com/jquery.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<script src=" http://builds.emberjs.com.s3.amazonaws.com/ember-data-0.13.js"></script>
<title>Ember JS</title>
</head>
@eccegordo
eccegordo / gist:5157473
Created March 13, 2013 23:27
fix for ruby saml Enable multiple attributes in SAML XML
def attributes
@attr_statements ||= begin
result = {}
stmt_element = xpath_first_from_signed_assertion('/a:AttributeStatement')
return {} if stmt_element.nil?
stmt_element.elements.each do |attr_element|
name = attr_element.attributes["Name"]
value = attr_element.elements.map { |e| e.text }
@eccegordo
eccegordo / simpleDoActionExample.jsx
Created December 29, 2011 00:46
Indesign Script Isolated doAction function
// Setup the variables
var theDocument = app.activeDocument;
var myInputs = {};
myInputs.inputDocumentName = "Foo Document Name";
myInputs.inputDocumentType = "Bar Doc Type";
var myOptions = {};
// Call the doAction function
@eccegordo
eccegordo / updateTextVariables.jsx
Created December 29, 2011 00:05
Indesign Script
// Functional edits added by Green4ever from Adobe forums.
// http://forums.adobe.com/thread/940934
// Logic behind this script
// theScript()
// is a wrapper function to provide functional scope to the entire script
// This function is invoked at the very bottom of the file
// main();