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
| task :stats => "app:stats_setup" | |
| # insert additional types into the statistics table and sort the list | |
| namespace :app do | |
| task :stats_setup do | |
| require 'rails/code_statistics' | |
| app_entries, spec_entries = [], [] | |
| until ::STATS_DIRECTORIES.empty? | |
| entry = STATS_DIRECTORIES.shift |
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
| # This is now a gem: https://github.com/barelyknown/rspec-context-private | |
| # /spec/support/with_private_instance_methods_public.rb | |
| RSpec.shared_context 'private', private: true do | |
| before :all do | |
| described_class.class_eval do | |
| @saved_private_instance_methods = private_instance_methods | |
| public *@saved_private_instance_methods | |
| 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
| BEFORE | |
| ------ | |
| Switched to branch 'master' | |
| Seans-MacBook-Pro:regions seandevine$ bin/rake stats | |
| +----------------------+-------+-------+---------+---------+-----+-------+ | |
| | Name | Lines | LOC | Classes | Methods | M/C | LOC/M | | |
| +----------------------+-------+-------+---------+---------+-----+-------+ | |
| | Controllers | 73 | 59 | 3 | 9 | 3 | 4 | | |
| | Helpers | 2 | 2 | 0 | 0 | 0 | 0 | |
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
| HTTP/1.1 200 OK | |
| X-Frame-Options: SAMEORIGIN | |
| X-XSS-Protection: 1; mode=block | |
| X-Content-Type-Options: nosniff | |
| Content-Type: text/javascript; charset=utf-8 | |
| X-Request-Id: 04d52807-e2f7-4aba-b593-76990947c8c6 | |
| X-Runtime: 0.074197 | |
| Transfer-Encoding: chunked | |
| b1c |
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
| // ActiveTable - a bookmarklet to make tables sortable and editable | |
| function init() { | |
| var aHrows = getHrows(); | |
| var numHrows = aHrows.length; | |
| var aHidden = getHiddenColumns(); | |
| ATpopup = document.createElement("div"); | |
| ATpopup.style.cssText = "position: absolute; visibility: hidden; padding: 0; font-family: Arial; background-color: rgba(255, 255, 255, 0.9); border-radius: .5em; text-align: center; box-shadow: .05em .05em .5em #00C;"; | |
| ATpopup.innerHTML = "<a href='sort' title='sort' onclick='sortColumn(); return false'><img border=0 src='http://stevesouders.com/images/sort_up_down.png' style='padding-top: 0.2em;'></a><br><a href='hide' style='color: #C00; font-family: monospace; font-size: 1.5em; text-decoration: none;' title='hide' onclick='hideColumn(); return false'>x</a>"; // TODO - use protocol-less URL for img |
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
| When Charley awoke one morning, he looked from the window and saw the ground deeply covered with snow. On the side of the house nearest the kitchen, the snow was piled higher than Charley’s head. | |
| “We must have a path through this snow,” said his father. “I would make one if I had time, but I must be at the office early this morning. “Do you think you could make the path, Son?” he asked little Charley. | |
| “I? The snow is higher than my head! How could I ever cut a path through that snow?” | |
| “How? By doing it little by little. Suppose you try,” said his father as he left for his office. | |
| So Charley got the snow shovel and set to work. He threw up first one shovelful and then another; but it was slow work. | |
| “I don’t think I can do it, Mother,” he said. “A shovelful is so little, and there is such a heap of snow.” | |
| “Little by little, Charley,” said his mother. “That snow fell in tiny bits, flake by flake, but you see what a great pile it has made.” | |
| “Yes, Mother, I see,” said Charley. “If I throw it away little by little, |
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
| // When I have a route that provides a model through a relationship... | |
| // app/routes/organization/buyer/loads.js | |
| export default Ember.Route.extend(AuthenticatedRouteMixin, { | |
| model: function() { | |
| return this.modelFor('organization/buyer').get('loads'); | |
| } | |
| }); | |
| // And I receive new records via the server (via push or poll), |
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 IntervalMerger | |
| def initialize(*intervals) | |
| @intervals = intervals | |
| end | |
| def merge | |
| @intervals.reduce([]) do |merged, i| | |
| is_merged = false | |
| merged.each_with_index do |m, index| |
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
| // using ember-jsonapi-resources as its store | |
| import Ember from 'ember'; | |
| export default Ember.Route.extend({ | |
| defaultOffset: 0, | |
| offset: null, |
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
| // login.hbs | |
| // {{input value=identification name='identification'}} | |
| // {{input value=password name='password' enter='authenticate'}} | |
| // <button name='login' {{action 'authenticate'}}>Login</button> | |
| // this test passes | |
| test('login with valid credentials', function(assert) { | |
| visit('/login'); | |
| andThen(function() { |
OlderNewer