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 Foo do | |
| let(:big_params) do | |
| { | |
| foo: foo, | |
| name: "name", | |
| ... | |
| } | |
| end | |
| let(:foo) { nil } |
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
| def available_if_enough_info | |
| if self.available? || self.display_only? | |
| if self.can_be_available? | |
| self.available! | |
| else | |
| self.display_only! | |
| end | |
| 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
| describe Purchase do | |
| let(:have_1) { FactoryGirl.build_stubbed(:have, asking_price: 15) } | |
| let(:have_2) { FactoryGirl.build_stubbed(:have, asking_price: 20) } | |
| describe "#amount_for_haves" do | |
| let(:amount_for_haves) { purchase.amount_for_haves([have_1, have_2], credit, promo) } | |
| let(:credit) { 0 } | |
| let(:expected_amount_for_haves) do | |
| # Order haves by asking_price, high to low. | |
| have_2_expected_amount_hash.merge(have_1_expected_amount_hash) |
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
| Threadflip.InfiniteScrollCollection = | |
| infiniteScroll: (options) -> | |
| success = options.success || -> | |
| offset = options.offset || 400 | |
| enabled = false | |
| start = (params = {}) -> | |
| unless enabled | |
| # Bind to the scroll event. | |
| $(window).scroll onScroll |
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
| %input(type="hidden" name="address[id]" value="#{address.id}") | |
| %fieldset | |
| %ul | |
| %li | |
| %label(for="address[first_name]") First Name | |
| %input(type="text" name="address[first_name]" value="#{address.first_name}" size="20") | |
| %li | |
| %label(for="address[last_name]") Last Name | |
| %input(type="text" name="address[last_name]" value="#{address.last_name}" size="20") |
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 | |
| %option(value="AL") Alabama | |
| %option(value="AK") Alaska | |
| %option(value="AZ") Arizona | |
| %option(value="AR") Arkansas | |
| %option(value="CA") California | |
| %option(value="CO") Colorado | |
| %option(value="CT") Connecticut | |
| %option(value="DE") Delaware | |
| %option(value="FL") Florida |
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
| dollarize = (n, currency = "$", decimals = 2, | |
| decimalSeparator = ".", thousandsSeparator = ",") -> | |
| if n instanceof String | |
| n = parseInt n, 10 | |
| sign = if n < 0 then "-" else "" | |
| wholeDigits = "" + Math.abs(n - (n % 1)) |
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
| // | |
| // NSManagedObject+KTManagedObject.h | |
| // Created by Kamil Tusznio on 12-07-10. | |
| // | |
| #import <CoreData/CoreData.h> | |
| @interface NSManagedObject (KTManagedObject) | |
| + (NSArray *)fetchAll; |
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> | |
| <title>Test App</title> | |
| <script type="text/javascript" src="../lib/es5-shim.js"></script> | |
| <script type="text/javascript" src="../lib/batman.js"></script> | |
| <script type="text/javascript" src="../lib/batman.solo.js"></script> | |
| <script type="text/javascript" src="../lib/extras/batman.rails.js"></script> | |
| <script type="text/javascript" src="../lib/coffee-script.js"></script> | |
| </head> |
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 Shopify.OrdersController extends Shopify.ApplicationController | |
| index: (params) -> | |
| @allOrders = Shopify.Order.get('all') | |
| @_filterOrders() | |
| addFilter: (type, value) -> | |
| @set "#{type}Filter", value | |
| @_filterOrders() | |
| _filterOrders: -> |