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
Apartment::TenantNotFound: One of the following schema(s) is invalid: "sdf-sdh" "demo-1", "shared_extensions" | |
/Users/almokhtar/Desktop/vroom/app/models/tenant.rb:41:in `switch_to' | |
/Users/almokhtar/Desktop/vroom/app/models/tenant.rb:77:in `block in with_each' | |
/Users/almokhtar/Desktop/vroom/app/models/tenant.rb:76:in `with_each' | |
/Users/almokhtar/Desktop/vroom/lib/tasks/quote.rake:6:in `block (2 levels) in <main>' | |
in rails console run | |
Apartment::Tenant.create('sdf-sdh') |
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
require 'rake' | |
Rails.application.load_tasks # <-- MISSING LINE | |
Rake::Task['my_task'].invoke |
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
set --universal fish_user_paths $fish_user_paths ~/.rbenv/shims/ |
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
brew install fish | |
# If you wish to make fish your default shell, add add /usr/local/bin/fish at the very top of /etc/shells, and execute chsh -s /usr/local/bin/fish. If not, then you can always type fish in bash. | |
# Oh My Fish | |
curl -L https://get.oh-my.fish | fish | |
omf install bobthefish |
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 palindrome?(str) | |
=begin | |
str.each_char.with_index do |char, i| | |
if str[i] != str[-i - 1] | |
return false | |
end | |
true | |
end | |
=end | |
reversed_str = '' |
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
git fetch origin pull/ID/head:BRANCHNAME | |
Replace the ID with the actual pull request id and BRANCHNAME with the branch name to which the pull request changes will be copied. Suppose the pull request id is 10 and the branch name we wish to create is demo-feature. Therefore, the command that we'll run | |
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
It's common knowledge in the *nix community, but for many new developers turning a Ruby script into an executable command line program is akin to magic. While there are other references on the internet, for the post here, I will briefly explain how to go from running a Ruby script by invoking Ruby directly, to running the script by its name alone. | |
We will start by assuming we have a simple Ruby script which prints "hello" on the command line. Our script's name will be greeter.rb. The file holds one line of Ruby code: | |
puts "Hello!" | |
To run the script, we must type ruby greeter.rb. Wouldn't it be nice to just type greeter instead and still get the script to run? Yes, it would. | |
First, we need to tell Bash what to do with our file since we won't be passing the script to Ruby directly. To do that, we add the following to the very top of our script: | |
#!/usr/bin/env ruby |
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
# [<%= ENV["APP_NAME"] + "_default" %>, 1] | |
- [<%= "dev_default" %>, 6] | |
bundle exec shoryuken -R -C config/shoryuken.yml -v -L | |
application.rb | |
config.active_job.queue_adapter = :async |
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
# to reset all files after staging | |
git reset | |
# to stage all files | |
git add --all | |
# reset staged file | |
git reset HEAD <file> | |
git checkout <file> |