Just wanted to share our setup, as reminder and help for others 😉
(do not forget to create a tmp and public folder inside your projects folder)
Just wanted to share our setup, as reminder and help for others 😉
(do not forget to create a tmp and public folder inside your projects folder)
git ls-files --others --exclude-standard | xargs rm
To use it as git rmuntracked, add to ~/.gitconfig
[alias] rmuntracked = "!git ls-files --others --exclude-standard | xargs rm"
(as you can see in my dotfiles)
This is a pretty hacky implementation of the feature we needed:
remove the default scope for some queries (e.g. update deleted records)
Code:
Usage
There is an less hacky alternative, but it did not work for us (AR 2.3.2)
The One imo not-so-obvious solution is:
And why it works is an exercise for the reader 😉
Update:
A crazy benchmark comparing different versions of power of 2 algorithms by reto
The fastest, still readable versions is:
There are some 40loc nested layout monsters on the interwebs, but it can be as simple as…