I hereby claim:
- I am shioyama on github.
- I am shioyama (https://keybase.io/shioyama) on keybase.
- I have a public key ASCdFFAduowUMfL1VWpiW8FOQVaqd21fHcKT6cFIAMLFfwo
To claim this, I am signing this object:
Spree::OrderPopulator.class_eval do | |
def populate_with_options(from_hash) | |
binding.pry | |
if variants_with_options = from_hash[:variants].select { |variant, quantity| quantity.is_a?(Hash) } | |
variants_with_options.each do |variant_id, options| | |
quantity = options.delete(:quantity) || 1 | |
attempt_cart_add(variant_id, quantity) | |
if (line_item = order.line_items.where(variant_id: variant_id).first) | |
line_item.assign_options!(options) |
I hereby claim:
To claim this, I am signing this object:
class MyModule < Module | |
def initialize(&block) | |
block.call(self) | |
end | |
end | |
MyModule.new do |mod| | |
puts mod.class | |
end | |
#=> MyModule |
2018-12-02 10:19:05 - [xwayland/xwm.c:418] XCB_ATOM_WM_NAME: echo -e "\e]710;xft:Sans:size=18\007" | |
2018-12-02 10:19:05 - [sway/sway/ipc-server.c:329] Sending window::title event | |
2018-12-02 10:19:05 - [xwayland/xwm.c:923] XCB_PROPERTY_NOTIFY (12582922) | |
2018-12-02 10:19:05 - [xwayland/xwm.c:688] unhandled X11 property 37 (WM_ICON_NAME) for window 12582922 | |
2018-12-02 10:19:05 - [xwayland/xwm.c:923] XCB_PROPERTY_NOTIFY (12582922) | |
2018-12-02 10:19:05 - [xwayland/xwm.c:688] unhandled X11 property 335 (_NET_WM_ICON_NAME) for window 12582922 | |
2018-12-02 10:19:05 - [xwayland/xwm.c:923] XCB_PROPERTY_NOTIFY (12582922) | |
2018-12-02 10:19:05 - [xwayland/xwm.c:572] WM_NORMAL_HINTS (18) | |
2018-12-02 10:19:05 - [xwayland/xwm.c:838] XCB_CONFIGURE_REQUEST (12582922) [4834x1512+-1457,-442] | |
2018-12-02 10:19:05 - [xwayland/xwm.c:923] XCB_PROPERTY_NOTIFY (12582922) |
# Sync files from webpacker manifest.json to S3 asset bucket. | |
# Based on asset_sync but much simplified for this case. | |
# | |
# Requirements | |
# | |
# Add fog to Gemfile. | |
# | |
# Environment variables: | |
# - AWS_S3_ASSETS_BUCKET_NAME | |
# - AWS_S3_REGION |
# It's annoying to write meta(required: false) everywhere, so let's just make | |
# "optional" do the same thing. | |
Dry::Types::Builder.module_eval do | |
def optional | |
meta(required: false) | |
end | |
end |
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
# | |
# This script demonstrates a performance regression introduced in https://github.com/rails/rails/pull/34405 | |
# That PR patched ActiveSupport::SafeBuffer methods gsub, gsub!, sub and sub! to set backreferences, but | |
# in doing so incurred a significant penalty. | |
# | |
# This script creates a random string with texts at random locations which are swapped with gsub. The string | |
# is random but seeded the same each run, so the same length produces the same string. | |
# |