Skip to content

Instantly share code, notes, and snippets.

View poteto's full-sized avatar
🥔
ポテト

lauren poteto

🥔
ポテト
View GitHub Profile
identify(...args) {
this.invoke('identify', ...args);
},
alias(...args) {
this.invoke('alias', ...args);
},
trackEvent(...args) {
this.invoke('trackEvent', ...args);
/* jshint unused: false */
import Ember from 'ember';
import canUseDOM from '../utils/can-use-dom';
function makeToString(ret) {
return function() { return ret; };
}
export default Ember.Object.extend({
init() {
import Ember from 'ember';
import canUseDOM from '../utils/can-use-dom';
import objectTransforms from '../utils/object-transforms';
import BaseAdapter from './base';
export default BaseAdapter.extend({
toStringExtension() {
return 'GoogleAnalytics';
},
import Ember from 'ember';
export default Ember.Route.extend({
metrics: Ember.inject.service(),
afterModel(model) {
const metrics = Ember.get(this, 'metrics');
const id = Ember.get(model, 'googleAnalyticsKey');
metrics.activateAdapters([
{ name: 'GoogleAnalytics', config: { id } }
@poteto
poteto / array.js
Last active August 29, 2015 14:27 — forked from NuckChorris/array.js
In Ember-CLI, transforms are located in app/transforms/name.js
// app/transforms/array.js
import Ember from 'ember';
import DS from 'ember-data';
export default DS.Transform.extend({
deserialize: function(value) {
if (Ember.isArray(value)) {
return Ember.A(value);
} else {
return Ember.A();
@poteto
poteto / .travis.yml
Last active September 21, 2015 15:21
Install PhantomJS 2 for TravisCI
---
language: node_js
node_js:
- "0.12"
sudo: false
cache:
directories:
- node_modules
@poteto
poteto / shim.js
Last active September 22, 2015 20:53
Import a global
/* globals thing, define */
define('thing', [], function() {
return { default: thing };
});
// now you can `import thing from 'thing';`
const MESSAGES = {
400(foo) {
// stuff
},
404(foo) {
// stuff
},
500(foo) {
// stuff
}

Ember Workshop

Short lightning talks about a certain Ember topic, then break students up into groups (pairs?) to work on short exercises. Each workshop session will be ~3 hours.

Assumptions about target audience

  • Has some knowledge of MVC via some other framework or vanilla JS/jQuery
  • Basic knowledge of AMD or CJS modules
  • Basic knowledge of JavaScript (ES2015 a bonus) and git
  • Open to public
  • Possibly multiple sessions
  • Different ember-cli environments

Solution

Copy paste, then click "Get Taco's Recommendation":

https://taco-spolsky.github.io/?____valueOf#|checksum=9861729|Lauren

Explanation

To solve this, we need to work backwards. First, look at the CandidateChooser.recommend function, since that is invoked when the recommend button is clicked. We know that random will always a positive value from 0 - 1, so it appears on first glance that the conditional will always set this.name to Taco Spolsky, which isn't what we want. In other words, we need to find a value for levelMap[level] that will be false for each of those conditionals.