This file contains 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
# config/application.rb | |
config.middleware.use "Loggo" | |
class Loggo | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
request = ActionDispatch::Request.new(env) |
This file contains 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
rescue_from StandardError do |exception| | |
if request.xhr? | |
render text: exception.message, :status => 500 | |
elsif request.format.json? | |
err = {error: exception.message} | |
err[:backtrace] = exception.backtrace.select do |line| | |
# filter out non-significant lines: | |
%w(/gems/ /rubygems/ /lib/ruby/).all? do |litter| | |
not line.include?(litter) |
This file contains 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
RSpec::Core::BacktraceFormatter.class_eval do | |
alias :native_format_backtrace :format_backtrace | |
alias :native_backtrace_line :backtrace_line | |
def format_backtrace(backtrace, options={}) | |
@lines = 0 | |
native_format_backtrace backtrace, options | |
end |
This file contains 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
Byebug::WhereCommand.class_eval do | |
def get_backtrace | |
(context.stack_size-1).downto(0).map do |index| | |
hash = Byebug::Frame.new(context, index).to_hash | |
path = hash[:file].gsub(Rails.root.to_s, '') | |
next if path.match BACKTRACE_TRASH | |
"#{hash[:mark]} #{path}:#{hash[:line]} #{hash[:call]}" |
This file contains 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
module IterationsSugar | |
def extract | |
result = ActiveArray.new | |
each_with_index do |item, index| | |
e = yield item, index | |
result << e unless e.nil? | |
end | |
result | |
end |
This file contains 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 error(msg) | |
hide_from_stack = true | |
Print.error "😱 #{msg}" | |
binding.pry if $launched_specs_examples < 2 | |
raise msg | |
end | |
def shit!(msg) | |
hide_from_stack = true |
This file contains 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
Rake::Application.class_eval do | |
def parse_task_string(_) | |
args = ARGV.clone | |
return args.shift, | |
args.reject{|_| _ =~ /^(\w+)=(.*)$/} # clean ENV variables | |
.join(' ').presence | |
end |
This file contains 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
# Insert this into Rakefile before Rails.application.load_tasks: require './lib/rake_patch.rb' | |
Rake::Application.class_eval do | |
alias origin_top_level top_level | |
def top_level | |
@top_level_tasks = [top_level_tasks.join(' ')] | |
origin_top_level | |
end |
This file contains 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
m503535072m630115302j636222860tl635678849 | |
v9787875253 |
This file contains 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
diff --git a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/CameraView.kt b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/CameraView.kt | |
index e666cb5..729fda2 100644 | |
--- a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/CameraView.kt | |
+++ b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/CameraView.kt | |
@@ -8,6 +8,7 @@ import android.content.res.Configuration | |
import android.hardware.camera2.* | |
import android.util.Log | |
import android.util.Range | |
+import android.util.Size | |
import android.view.* |