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
Seans-MacBook-Pro:blackjack-rails-api seandevine$ bundle exec rspec --format documentation | |
Run options: include {:focus=>true} | |
All examples were filtered out; ignoring {:focus=>true} | |
Randomized with seed 31252 | |
V1::CardResource | |
has no updatable fields | |
has no creatable fields |
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() { |
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
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
// 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
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
describe "#after_commit" do | |
context "on: :create" do | |
before do | |
expect(subject).to receive(:transaction_record_state).with(:new_record).and_return(true) | |
end | |
it "calls initiate_async" do | |
expect(subject).to receive(:initiate_async) | |
subject.run_callbacks(:commit) | |
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
// 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
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 |