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
# Prepared for https://stackoverflow.com/questions/70790708/testing-enque-of-nested-worker-from-another-sidekiq-worker | |
require 'sidekiq' | |
require 'sidekiq/testing' | |
require 'rspec' | |
class WorkerOne | |
include Sidekiq::Worker | |
def perform(arg_1, arg_2) |
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
# frozen_string_literal: true | |
# Read the blog: https://tejasbubane.github.io/posts/2021-12-18-rails-7-postgres-generated-columns/ | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
# Activate the gem you are reporting the issue against. |
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
Offenses: | |
brew/Library/Homebrew/test/pkg_version_spec.rb:20:5: C: RSpec/IdenticalEqualityAssertion: Identical expressions on both sides of the equality may indicate a flawed test. | |
expect(described_class.parse("1.0_1")).to be == described_class.parse("1.0_1") | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
canvas-lms/gems/adheres_to_policy/spec/adheres_to_policy/class_methods_spec.rb:51:5: C: RSpec/IdenticalEqualityAssertion: Identical expressions on both sides of the equality may indicate a flawed test. | |
expect(@some_class.policy).to eql(@some_class.policy) | |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
canvas-lms/spec/controllers/gradebooks_controller_spec.rb:2883:7: C: RSpec/IdenticalEqualityAssertion: Identical expressions on both sides of the equality may indicate a flawed test. | |
expect(@controller.post_grades_ltis).to eq(@controller.post_grades_ltis) |
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
# No need to run this everyday - once a month should be fine | |
# Remove cache: | |
sudo pacman -Scc | |
yay -Scc | |
# Remove unwanted dependencies: | |
yay -Yc | |
# Remove orphan packages |
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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
# Activate the gem you are reporting the issue against. |
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
# Thanks to this mailing list message: https://mail.haskell.org/pipermail/haskell-cafe/2011-March/090170.html | |
# Note: This removes ALL haskell versions & anything related to it | |
sudo rm -rf /Library/Frameworks/GHC.framework | |
sudo rm -rf /Library/Frameworks/HaskellPlatform.framework | |
sudo rm -rf /Library/Haskell | |
rm -rf .cabal | |
rm -rf .ghc | |
rm -rf ~/Library/Haskell | |
find /usr/bin /usr/local/bin -type l | \ |
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
# Make sure rack & rspec are installed -> gem install rack rspec | |
# Run this script using rspec -> rspec middleware.rb | |
require 'rack' | |
class BlockActions | |
def initialize(app) | |
@app = app | |
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
AllCops: | |
TargetRubyVersion: 2.5 | |
Exclude: | |
- 'config/**/*.rb' | |
- 'db/**/*.rb' | |
- '**/Rakefile' | |
- '**/config.ru' | |
- '**/spec_helper.rb' | |
- '**/rails_helper.rb' | |
- 'lib/tasks/db_extensions.rake' |
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
# For stackoverflow question: https://stackoverflow.com/questions/55339129/how-to-test-lock-mechanism | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
# Activate the gem you are reporting the issue against. |
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
// These are my notes from learning Rust Macros during a meetup | |
// https://www.meetup.com/rustox/events/256709420/ | |
// I had not done any Rust before - but was still able to learn a lot!! | |
use std::collections::HashMap; | |
// All these macros run at compile time | |
// Simplest macro | |
macro_rules! hello { |
NewerOlder