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
# frozen_string_literal: true | |
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do |
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
# frozen_string_literal: true | |
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do |
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
# frozen_string_literal: true | |
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do |
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
# frozen_string_literal: true | |
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do |
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
# frozen_string_literal: true | |
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do |
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
# frozen_string_literal: true | |
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do |
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 QueenCheck | |
def self.safe_moves(q, k) | |
z=->(p){q[0]==p[0]||q[1]==p[1]||(-7..7).map{|d|q.map{|x|x+d}}.include?(p)};z[k]?(t=[-1,0,1]).product(t).count{|a,b|(c=[k[0]+a,k[1]+b]).all?{|x|(1..8)===x}&&!z[c]}:-1 | |
end | |
def self.safe_moves_explanation(queen_coords, king_coords) | |
is_check = -> (king_coords) { | |
return true if queen_coords[0] == king_coords[0] || queen_coords[1] == king_coords[1] | |
(-7..7).map do |diagonal_move| |
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
SystemStackError - SystemStackError: | |
kernel/common/type.rb:412:in `object_initialize_clone' | |
kernel/bootstrap/string.rb:103:in `clone' | |
kernel/common/string.rb:1648:in `each_line' | |
kernel/common/enumerator.rb:70:in `each_with_block' | |
kernel/common/enumerator.rb:60:in `each' | |
kernel/common/enumerable.rb:150:in `to_a' | |
kernel/common/string.rb:1675:in `lines' | |
racc (1.4.10) lib/racc/compat.rb:27:in `to_a' | |
activesupport (4.0.1) lib/active_support/cache.rb:96:in `retrieve_cache_key' |
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
balanced.bankAccount.validate({ | |
bank_code: '321174851', | |
account_number: '09877765432111111', | |
name: 'Tommy Q. CopyPasta' | |
}) |
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 InvitationsController < Devise::InvitationsController | |
# GET /resource/invitation/accept?invitation_token=abcdef | |
def edit | |
if params[:invitation_token] && self.resource = resource_class.to_adapter.find_first( :invitation_token => params[:invitation_token] ) | |
session[:invitation_token] = params[:invitation_token] | |
render :edit | |
else | |
set_flash_message(:alert, :invitation_token_invalid) | |
redirect_to after_sign_out_path_for(resource_name) |
NewerOlder