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 Digest::Jenkins | |
| MAX_32_BIT = 4294967295 | |
| def self.digest(string) | |
| hash = 0 | |
| string.each_byte do |byte| | |
| hash += byte | |
| hash &= MAX_32_BIT |
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
| Flub = Struct.new(:foo, :bar) do | |
| def to_hash; to_h; end | |
| end | |
| def named(foo:, bar:) | |
| p "foo: #{foo}" | |
| p "bar: #{bar}" | |
| end | |
| named(**Flub.new(1, 2)) |
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
| Uncaught TypeError: Cannot read property 'shouldSupercede' of undefinedvendor.js:59348 | |
| __exports__.default.subclass.applyToHandlersvendor.js:59287 | |
| __exports__.default.subclass.applyToStatevendor.js:58713 | |
| Router.applyIntentvendor.js:39545 | |
| calculatePostTransitionStatevendor.js:39328 | |
| EmberObject.extend._hydrateUnsuppliedQueryParamsvendor.js:39269 | |
| EmberObject.extend._prepareQueryParamsvendor.js:34131 | |
| computeLinkViewHrefvendor.js:25813 | |
| ComputedPropertyPrototype.getvendor.js:31070 | |
| getvendor.js:55606 |
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
| git:(develop) ✗ ember g server users | |
| version: 0.1.3 | |
| valid watchman found, version: [3.0.0] | |
| Unknown blueprint: server |
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 PartialReportForm | |
| include DelegatingFormObject.new(Report) | |
| delegate :name, :name=, | |
| to: :report | |
| validates :name, | |
| presence: true | |
| 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
| # this comes included in ActiveSupport 4+ | |
| unless ActiveSupport::VERSION::MAJOR > 3 | |
| require 'date' | |
| module DateAndTime | |
| module Zones | |
| # Returns the simultaneous time in <tt>Time.zone</tt> if a zone is given or | |
| # if Time.zone_default is set. Otherwise, it returns the current time. | |
| # | |
| # Time.zone = 'Hawaii' # => 'Hawaii' |
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
| <div class="stack"> | |
| lorem ipsum | |
| </div> |
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
| require 'nokogiri' | |
| RSpec::Matchers.define :have_xml do |xpath, matcher| | |
| match do |body| | |
| doc = Nokogiri::XML::Document.parse(body) | |
| nodes = Array(doc.xpath(xpath)) | |
| nodes.map! { |node| node.respond_to?(:content) ? node.content : node } | |
| if nodes.empty? | |
| false |