Skip to content

Instantly share code, notes, and snippets.

View ppcano's full-sized avatar

Pepe Cano ppcano

View GitHub Profile
@ppcano
ppcano / Brocfile.js
Created April 20, 2014 12:40
Failing broccoli plugin
var features = match('.', 'ember_features.json');
emberModules = defeatureifyFilter2([features, emberModules]);
@ppcano
ppcano / animated_component.js
Created April 30, 2014 11:10
First Route Animation
var AnimatedLayoutComponent = Ember.Component.extend({
action: 'animationEnd',
animatedProperties: null,
transitionEnd: function(evt) {
var animatedProperties = this.get('animatedProperties').split(' ');
var propertyName = evt.originalEvent.propertyName;
if (animatedProperties.indexOf(propertyName) !== -1) {
@ppcano
ppcano / handler_info.js
Created April 30, 2014 18:05
Rewriting HandlerInfo.js
import Promise from 'rsvp/promise';
var HandlerInfo = requireModule("router/handler-info")['HandlerInfo'];
var bind = requireModule("router/utils").bind;
HandlerInfo.prototype.resolve = function(async, shouldContinue, payload) {
var checkForAbort = bind(this.checkForAbort, this, shouldContinue),
beforeModel = bind(this.runBeforeModelHook, this, async, payload),
model = bind(this.getModel, this, async, payload),
afterModel = bind(this.runAfterModelHook, this, async, payload),
animation = bind(this.runAnimationHook, this, async, payload),
@ppcano
ppcano / animated_component.js
Last active August 29, 2015 14:00
Ember Route Animation
// Component which send `animationEnd` action when
// a transitionEnd event is fired in a property defined included at `animatedProperties`
var AnimatedLayoutComponent = Ember.Component.extend({
action: 'animationEnd',
animatedProperties: null,
transitionEnd: function(evt) {
var animatedProperties = this.get('animatedProperties').split(' ');
@ppcano
ppcano / test_create_record_with_sideloaded_and_belongs_to.js
Created May 8, 2014 19:27
Failing tests: RESTAdapter create - a sideloaded record with a relationship to the primary record should not fetch the relationship
test("create - a sideloaded record with a belongsTo relationship to the primary record should not fetch the relationship", function() {
expect(3);
var postName = "Rails is omasake";
ajaxResponse({
post: [{
id: "1",
name: postName
}],
@ppcano
ppcano / tests.js
Created May 8, 2014 19:31
findQuery//update - a sideloaded record with a relationship to the primary record should not fetch the relationship record
test("update - a sideloaded record with a relationship to the primary record should not fetch the relationship record", function() {
expect(4);
var postName = "Rails is omasake";
var postName2 = "EmberJS is omasake";
ajaxResponse({
post: [{
id: "1",
name: postName
Remote Address:46.137.168.22:443
Request URL:https://production-cybersource-invibe.herokuapp.com/payment_confirmation
Request Method:POST
Status Code:200 OK
**Request Headersview source**
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
<form id="payment-confirmation" action="https://testsecureacceptance.cybersource.com/silent/pay" method="post">
<input type="hidden" name="access_key" value="8cd84e0a30f6370baa4c59b94a857c0c">
<input type="hidden" name="profile_id" value="invibe1">
<input type="hidden" name="transaction_uuid" value="8083af70f3f2823ec562c13847b03dff">
<input type="hidden" name="signed_field_names" value="access_key,profile_id,transaction_uuid,signed_field_names,unsigned_field_names,signed_date_time,locale,transaction_type,reference_number,amount,currency,payment_method,card_type,card_number,card_expiry_date,bill_to_forename,bill_to_surname,bill_to_email,bill_to_phone,bill_to_address_line1,bill_to_address_city,bill_to_address_state,bill_to_address_country,bill_to_address_postal_code">
<input type="hidden" name="unsigned_field_names" value="">
<input type="hidden" name="locale" value="en">
<input type="hidden" name="transaction_type" value="authorization">
<input type="hidden" name="reference_numb
<html><head>
<title>Secure Acceptance - Payment Form Example</title>
</head>
<body >
<form id="payment-confirmation" action="https://testsecureacceptance.cybersource.com/silent/pay" method="post">
<input type="hidden" name="access_key" value="8cd84e0a30f6370baa4c59b94a857c0c">
<input type="hidden" name="profile_id" value="invibe1">
<input type="hidden" name="transaction_uuid" value="bb8262412a05aa5c7553fc1315f4f294">
Built with error:
Error: EISDIR, illegal operation on a directory
at Object.fs.readSync (fs.js:476:19)
at Object.fs.readFileSync (fs.js:310:28)
at addFile (/Users/pepe/Git/emberjs/examples/ember-app/node_modules/broccoli-concat/index.js:58:31)
at /Users/pepe/Git/emberjs/examples/ember-app/node_modules/broccoli-concat/index.js:43:7
at invokeCallback (/Users/pepe/Git/emberjs/examples/ember-app/node_modules/broccoli/node_modules/rsvp/dist/commonjs/rsvp/promise.js:228:21)
at publish (/Users/pepe/Git/emberjs/examples/ember-app/node_modules/broccoli/node_modules/rsvp/dist/commonjs/rsvp/promise.js:176:9)
at publishFulfillment (/Users/pepe/Git/emberjs/examples/ember-app/node_modules/broccoli/node_modules/rsvp/dist/commonjs/rsvp/promise.js:312:5)
at flush (/Users/pepe/Git/emberjs/examples/ember-app/node_modules/broccoli/node_modules/rsvp/dist/commonjs/rsvp/asap.js:41:9)