This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| moduleFor('controller:application', 'Application controller'); | |
| test('it has access to the currentUser object', function() { | |
| var controller = this.subject(); | |
| Ember.run(function() { | |
| var user = controller.get('currentUser'); | |
| ok(user, "User should exist but doesn't"); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| App.WidgetRoute = Ember.Route.extend({ | |
| model: function(params) { | |
| return Ember.RSVP.hash({ | |
| widget: this.store.find('widget' params.id), | |
| cogs: App.MyCustomAjax() | |
| }) | |
| }, | |
| setupController: function (controller, rsvp) { | |
| controller.set('model', rsvp.widget); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| App.PaginationMixin = Ember.Mixin.create({ | |
| // Define a property called "paginate" that returns the collection to paginate. | |
| currentPage: 0, | |
| perPage: 15, | |
| collectionSize: Ember.computed.alias('paginate.length'), | |
| actions: { | |
| setPage: function(pageNumber) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.I18n = { | |
| pushDictionary: function(translations) { | |
| I18n.translations = Ember.Object.create(translations); | |
| }, | |
| t: function(key, opts) { | |
| var translation = I18n.translations.get('en.' + key); | |
| opts = opts || {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns problems.one) | |
| (defn- multiple-of [num x] (zero? (mod x num))) | |
| (defn- multiples-of-three-and-five [x] | |
| (or (multiple-of 3 x) | |
| (multiple-of 5 x))) | |
| (defn- real-numbers-below [x] (range 1 x)) | |
| (defn multiples-of-three-and-five-below [x] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # my_file.coffee | |
| # | |
| # view = null | |
| # | |
| # ready controllers: ['sessions'], -> | |
| # view = new Backbone.View() | |
| # view.renderAndAppendTo('#my-widget') | |
| # | |
| # unload controllers: ['sessions'], -> | |
| # view.remove() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Foo | |
| def self.foo=(value) | |
| @foo = value | |
| end | |
| def self.foo | |
| @foo | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>FRP Infinite Scroll using Bacon.js</title> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/bacon.js/0.7.53/Bacon.min.js"></script> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.7.0/lodash.min.js"></script> | |
| <style type="text/css"> | |
| body { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select.form-control { | |
| -webkit-appearance: none; | |
| -moz-appearance: none; | |
| background-color: #fff; | |
| background-image: url("select.png"); | |
| background-repeat: no-repeat; | |
| background-position: right center; | |
| padding-right: 30px; | |
| &:-moz-focusring { |