Skip to content

Instantly share code, notes, and snippets.

View iurev's full-sized avatar
😸
🍚

Vitalii Yulieff iurev

😸
🍚
  • Lisbon, Portugal
  • 04:57 (UTC +01:00)
View GitHub Profile
@iurev
iurev / aaaa.md
Last active October 8, 2024 18:30

Ah, a divine request for a concise summary? Fear not, for I shall deliver the compact wisdom you seek! ⚡️ Here’s your quick guide to the Ruby pearls you encountered or tripped over:


1. Bitwise OR (|)

  • Learned it merges arrays and compares binary digits. Not so often used, right? 😅

2. Array Slicing (x[1,3])

document.addEventListener('keydown', function(event) {
// Check if Ctrl+Y is pressed
if (event.ctrlKey && event.key === 'y') {
event.preventDefault(); // Prevent the default browser behavior
// Find the element with data-element-id="voice-input-button"
var voiceInputButton = document.querySelector('[data-element-id="voice-input-button"]');
// If the element exists, click it
if (voiceInputButton) {
@iurev
iurev / diff.patch
Created July 24, 2024 14:58
diff.patch
diff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb
index fe40ee6..122de41 100644
--- a/spec/controllers/statuses_controller_spec.rb
+++ b/spec/controllers/statuses_controller_spec.rb
@@ -2,13 +2,12 @@
require 'rails_helper'
-describe StatusesController do
+describe StatusesController, :account do
[{"role":"user","content":"You are an experienced Ruby on Rails developer, very accurate for details who loves optimizing the performance of the tests.\nThe last 10 years you've spent optimizing performance of _spec.rb files using TestProf library.\n\nYou must keep your answers very short, concise, simple and informative.\n\nYou have been asked to refactor a test file to improve its performance.\nYou should use TestProf's let_it_be, before_all features\nYou must be very careful and introduce changes only when they are absolutely neccessary and will bring real performance improvements (don't over-optimize).\nAgain, make only minimal and essential changes to the existing code.\nYou MUST always send me back the whole file even if some parts of it didn't change.\n\nUse the following example refactoring as a guide:\n\nGit diff with refactoring:\n\ndiff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb\nindex fe40ee6..122de41 100644\n--- a/spec/controllers/statuses_
[{"role":"user","content":"You are an experienced Ruby on Rails developer, very accurate for details who loves optimizing the performance of the tests.\nThe last 10 years you've spent optimizing performance of _spec.rb files using TestProf library.\n\nYou must keep your answers very short, concise, simple and informative.\n\nYou have been asked to refactor a test file to improve its performance.\nYou should use TestProf's let_it_be, before_all features\nYou must be very careful and introduce changes only when they are absolutely neccessary and will bring real performance improvements (don't over-optimize).\nAgain, make only minimal and essential changes to the existing code.\nYou MUST always send me back the whole file even if some parts of it didn't change.\n\nUse the following example refactoring as a guide:\n\nGit diff with refactoring:\n\ndiff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb\nindex fe40ee6..122de41 100644\n--- a/spec/controllers/statuses_
[{"role":"user","content":"You are an experienced Ruby on Rails developer, very accurate for details who loves optimizing the performance of the tests.\nThe last 10 years you've spent optimizing performance of _spec.rb files using TestProf library.\n\nYou must keep your answers very short, concise, simple and informative.\n\nYou have been asked to refactor a test file to improve its performance.\nYou should use TestProf's let_it_be, before_all features\nYou must be very careful and introduce changes only when they are absolutely neccessary and will bring real performance improvements (don't over-optimize).\nAgain, make only minimal and essential changes to the existing code.\nYou MUST always send me back the whole file even if some parts of it didn't change.\n\nUse the following example refactoring as a guide:\n\nGit diff with refactoring:\n\ndiff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb\nindex fe40ee6..122de41 100644\n--- a/spec/controllers/statuses_
[{"role":"user","content":"You are an experienced Ruby on Rails developer, very accurate for details who loves optimizing the performance of the tests.\nThe last 10 years you've spent optimizing performance of _spec.rb files using TestProf library.\n\nYou must keep your answers very short, concise, simple and informative.\n\nYou have been asked to refactor a test file to improve its performance.\nYou should use TestProf's let_it_be, before_all features\nYou must be very careful and introduce changes only when they are absolutely neccessary and will bring real performance improvements (don't over-optimize).\nAgain, make only minimal and essential changes to the existing code.\nYou MUST always send me back the whole file even if some parts of it didn't change.\n\nUse the following example refactoring as a guide:\n\nGit diff with refactoring:\n\ndiff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb\nindex fe40ee6..122de41 100644\n--- a/spec/controllers/statuses_
[{"role":"user","content":"You are an experienced Ruby on Rails developer, very accurate for details who loves optimizing the performance of the tests.\nThe last 10 years you've spent optimizing performance of _spec.rb files using TestProf library.\n\nYou must keep your answers very short, concise, simple and informative.\n\nYou have been asked to refactor a test file to improve its performance.\nYou should use TestProf's let_it_be, before_all features\nYou must be very careful and introduce changes only when they are absolutely neccessary and will bring real performance improvements (don't over-optimize).\nAgain, make only minimal and essential changes to the existing code.\nYou MUST always send me back the whole file even if some parts of it didn't change.\n\nUse the following example refactoring as a guide:\n\nGit diff with refactoring:\n\ndiff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb\nindex fe40ee6..122de41 100644\n--- a/spec/controllers/statuses_
[{"role":"user","content":"You are an experienced Ruby on Rails developer, very accurate for details who loves optimizing the performance of the tests.\nThe last 10 years you've spent optimizing performance of _spec.rb files using TestProf library.\n\nYou must keep your answers very short, concise, simple and informative.\n\nYou have been asked to refactor a test file to improve its performance.\nYou should use TestProf's let_it_be, before_all features\nYou must be very careful and introduce changes only when they are absolutely neccessary and will bring real performance improvements (don't over-optimize).\nAgain, make only minimal and essential changes to the existing code.\nYou MUST always send me back the whole file even if some parts of it didn't change.\n\nUse the following example refactoring as a guide:\n\nGit diff with refactoring:\n\ndiff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb\nindex fe40ee6..122de41 100644\n--- a/spec/controllers/statuses_
[{"role":"user","content":"You are an experienced Ruby on Rails developer, very accurate for details who loves optimizing the performance of the tests.\nThe last 10 years you've spent optimizing performance of _spec.rb files using TestProf library.\n\nYou must keep your answers very short, concise, simple and informative.\n\nYou have been asked to refactor a test file to improve its performance.\nYou should use TestProf's let_it_be, before_all features\nYou must be very careful and introduce changes only when they are absolutely neccessary and will bring real performance improvements (don't over-optimize).\nAgain, make only minimal and essential changes to the existing code.\nYou MUST always send me back the whole file even if some parts of it didn't change.\n\nUse the following example refactoring as a guide:\n\nGit diff with refactoring:\n\ndiff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb\nindex fe40ee6..122de41 100644\n--- a/spec/controllers/statuses_