Skip to content

Instantly share code, notes, and snippets.

View eccegordo's full-sized avatar

Gordon Potter eccegordo

View GitHub Profile
@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();
@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 / 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 }
<!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: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>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://twitter.github.io/bootstrap/assets/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" />
<script src="http://twitter.github.io/bootstrap/assets/js/bootstrap.js"></script>
<meta name="description" content="Minimalist Ember JSBin" />
<script src="http://code.jquery.com/jquery.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script>
@eccegordo
eccegordo / jsbin.oREkaXI.html
Created August 18, 2013 07:02
Ember JS Promise Example Cookie Maker
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0-rc.3/handlebars.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/ember.js/1.0.0-rc.6/ember.min.js"></script>
<script src=" http://builds.emberjs.com.s3.amazonaws.com/ember-data-0.13.js"></script>
See it in action
http://jsbin.com/omIZeq/4
@eccegordo
eccegordo / models.js
Created August 23, 2013 21:07
Ember model fixtures, using Ember object for stubbed data.
App.Store = DS.Store.extend({
adapter: DS.FixtureAdapter.create({ latency: 400 }),
});
App.Month = DS.Model.extend({
test: DS.attr('number'),
companies: DS.hasMany('App.Company')
});
App.Company = DS.Model.extend({
@eccegordo
eccegordo / jsbin.OvONejo.html
Created August 27, 2013 04:44
Render dynamic template based on model info
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script>
<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>