maven surefire run with test timeout option
Assuming you have the maven-surefire-plugin, this option is useful:
activerecord check date between
Was writing a raw query, when I remembered about range support:
^M instead of enter
Sometimes my terminal outputs ^M when pressing enter. Running the command stty sane fixes it. Found the answer here
terminal inside neovim
The command :terminal will start a new command. For example:
:term rails c
would start rails c in a new buffer. To get out of terminal mode, and be able to switch through splits, use the following combination: ctrl-\ ctrl-n. That is ctrl-backspace, followed by a ctrl-n.
cloning with different ssh key from github
I needed to do a git clone using a different key than my own. This was what I had to do to get it to work:
- in ~/.ssh/config , I setup the following:
Host github-work HostName github.com IdentityFile /path/to/the/private_key User the_github_username
- add the key to the ssh-agent:
ssh-add /path/to/private/key
- export GIT_SSH_COMMAND:
export GIT_SSH_COMMAND="ssh -i /path/to/the/private_key"
- the actual clone:
git clone git@github-work:organization_name/repo.git
This StackOverflow answer helped me with this.
Vagrant experienced a version conflict with some installed plugins!
Tried to run vagrant ssh-config from within capistrano, and got the following message:
Vagrant experienced a version conflict with some installed plugins! This usually happens if you recently upgraded Vagrant. As part of the upgrade process, some existing plugins are no longer compatible with this version of Vagrant. The recommended way to fix this is to remove your existing plugins and reinstall them one-by-one. To remove all plugins: ...
Turns out, the fix was to run ssh-config like this:
system("unset RUBYLIB; vagrant ssh-config")
Found the solution here
capistrano invoke task with params
Imagine the following code:
In the above example, the task called_with can be passed a param form the command line:
cap called_with -s branch=master
And this allows us to send a parameter, from the commandline. The output will be:
called with branch master
If you need to call a parameterized task from another task, the above task, callerz illustrates one way of getting that result. You invoke it like this:
cap callerz
And inside, it sets the variable branch to a value. The output will be:
called with branch potato
The above code was tested in capistrano 2.15.8
iex config file
If you defined a
file, it’s content will be evaluated when iex starts.
Easy to setup aliases to stuff1
.iex.exs