Skip to content

Instantly share code, notes, and snippets.

Tate Johnson tatey

Block or report user

Report or block tatey

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:10459627
#!/usr/bin/env ruby
#
# End to end tests.
#
# Starts the application server and BrowserStack tunnel in the background
# and then runs protractor. Stops the server and tunnel after protractor
# finishes.
require 'bundler/setup'
require 'dotenv'
View protractor.conf.js
exports.config = {
// The address of a running selenium server.
seleniumAddress: 'http://hub.browserstack.com/wd/hub',
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome',
'browserstack.tunnel': 'true',
'browserstack.debug': 'true',
'browserstack.user' : process.env.BROWSERSTACK_USER,
View 0_template.html.haml
%div{ng: {controller: 'planner.coverImageController', init: @plan.to_json}}
%img{ng: {src: 'getCoverImageUrl()'}}
// The cloudinary directive communicates with the cover image controller through `done`.
// When the fileuploaddone
%div{cloudinary: 'true', done: 'fileDidUpload(url)', timestamp: cloudinary_info.timestamp, corscallback: cloudinary_info.cors_callback, signature: cloudinary_info.signature, apikey: cloudinary_info.api_key}
@tatey
tatey / gist:8793377
Last active Aug 29, 2015
Export `foo` to `window`.
View gist:8793377
(function (global) {
'use strict';
var foo = function () {
return this;
};
if (global.namespace === undefined) {
global.namespace = {};
}
@tatey
tatey / 0_template.html
Created Jan 31, 2014
API I'd like to consume for uploading images to Cloudinary with AngularJS.
View 0_template.html
<div ng-controller="AvatarController">
<img ng-src="getImageUrl()" cloudinary open="imageDialogIsOpen" change="imageDidChange(url)">
<button ng-click="openImageDialog()">Change Avatar</button>
</div>
View class.js
TimeRange.prototype.getEnd = function() {
var end = this.end;
if (end) {
return end;
} else {
return parseInt(this.start) + 3600 // 1 hour
}
};
View template.html
<div ng-switch on="{{type}}">
<div ng-switch-where="X" ng-include="X-template.html"></div>
<div ng-switch-where="Y" ng-include="Y-template.html"></div>
</div>
<script type="text/x-template" id="X-template.html">
</script>
<script type="text/x-template" id="Y-template.html">
</script>
View show.html.haml
%button{ng: {click: 'comments.addComment()'}, tbd: {require: {invitee: 'true'}}}
View 0_donations.js
if (typeof window.EDH === 'undefined') {
window.EDH = {};
}
if (typeof window.EDH.Donation === 'undefined') {
window.EDH.Donation = {};
}
var Donation = window.EDH.Donation;
View donations.js
braintree.onSubmitEncryptForm($form, function(event) {
disableSubmitButton(true);
event.preventDefault();
var payment = Payment($form.serialize());
payment.save(function() {
// Success
window.location = payment.thank_you_url;
}, function() {
// Failure
You can’t perform that action at this time.