Skip to content

Instantly share code, notes, and snippets.

@krisselden
krisselden / index.hbs
Created April 25, 2014 06:01
sortable-list component example
{{#each fruits}}
{{this}}
{{/each}}
{{draggable-list values=fruits}}
/* jshint node: true */
/**
* This is a hack-ish way of triggering Karma runs on broccoli builds.
*/
var path = require('path');
var spawn = require('child_process').spawn;
var broccoli = require('broccoli');
function loadScript(module) {
var head = document.getElementsByTagName("head")[0];
var script = document.createElement("script");
return new RSVP.Promise(function(resolve, reject) {
script.language = "javascript";
script.src = module.url;
script.onload = function() {
resolve(module);
};
head.appendChild(script);
@joefiorini
joefiorini / structure.md
Last active August 29, 2015 13:57
eak-rails transition

Basically, it's a minimal Rails-API app (based loosely on this gist) embedded in an api folder in the root. Then the rest of it is a stock ember-cli setup. I don't know yet exactly how to make Rails look elsewhere for initializers, environments & locales, going to look into it.

api/              *.rb
  controllers/
  models/
  initializers/
  environments/
  locales/
  config.rb

routes.rb

@raytiley
raytiley / auth.js
Last active August 29, 2015 13:56
A controller using SimpleLogin from Firebase. Returns promises from login / logout to make working with Ember Routing simple.
var dbRef = new Firebase("https://YOUR-FIREBASE.firebaseio.com/");
export default Ember.Controller.extend({
/**
@property currentUser
@type {User}
@default null
*/
currentUser: null,
var compile = Ember.Handlebars.compile;
module('Ember.Test Unit Tests', {
setup: function() {
Ember.Test.setupUnitTest();
},
teardown: function() {
Ember.Test.teardownUnitTest();
}
});
@jvns
jvns / interview-questions.md
Last active May 14, 2024 18:47
A list of questions you could ask while interviewing

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

@kurko
kurko / _README.md
Last active January 1, 2016 04:38
Ember.js - Writing contract tests for your Ember Data models

Ember.js Testing package was a great addition to the project. It allowed us to have fast specs to guarantee the defined behavior. However, there's no convention on how you should guarantee that your models, the heart of any Ember.js application, are valid in relation to your backend.

Put another way, if you have an User model with a name attribute, how can you be sure that your backend is still responding with {"user": {"name": "Your Name"}}? So, even though your acceptance specs pass, you're stubbing out your models with FIXTURES.

Most people either manually test their apps or create an end-to-end test with the backend server, which is slow as hell (think of Capybara). The good news is that there are conventions for solving this since like forever. One way to guarantee this integrity is via Contract tests (http://martinfowler.com/bliki/IntegrationContractTest.html). Basically, you have a test to guarantee your models are matching your backend.

Using server-side end-to-end tests have many drawbacks,