Exclude linting & formatting commits when running Git blame
As of Git 2.23 there is a way to configure a list of commits for git blame to ignore.
Read more [tekin.co.uk]
Posts tagged with tips
As of Git 2.23 there is a way to configure a list of commits for git blame to ignore.
Read more [tekin.co.uk]
Databases are the backbone of most modern systems, so taking some time to understand how they work is a good investment for any developer.
Read more [hakibenita.com]
Join thousands of developers
Every two weeks, I share practical tips, tutorials, and behind-the-scenes insights from maintaining 300+ open source packages.
No spam. Unsubscribe anytime. You can also follow me on X.
Starting a side project is easy. Actually finish it is hard. Hugo Zap offers some good tips on how to properly finish a side project.
Read more [hugozap.com]
Nikita Prokopov shares some good insights on why having a good monitor is important. MacOS users: your fonts will look much better with font smoothing turned off.
Read more [tonsky.me]
Here are some Bash tips that are relatively obscure, or rarely seen, but still worth knowing about.
Read more [zwischenzugs.com]
At Laravel News, Stefan Bauer shared some cool Eloquent tips and tricks
Read more [laravel-news.com]
Dancing artisan Christoph Rumpel released a new video series on how to make PhpStorm look pretty and get the most out of it.
Read more [blog.jetbrains.com]
Julien Bourdeau explains how you can use the auto_prepend_file option of PHP.
Read more [www.sigerr.org]
– liamhammett.com - submitted by Liam Hammett
Some tips when dealing with lots of macros in Laravel, and composing them into mixin classes elegantly.
Read more [liamhammett.com]
?You can mutate request data using @laravelphp 's form requests instead of doing it in the controller. By overwriting the validationData() method, you can mutate data BEFORE validation. Overwrite the validated() method to mutate AFTER validation. #Laravel #php pic.twitter.com/VAVXYAHCFC
— Neil Keena (@neilkeena) November 4, 2019
Read more [twitter.com]
? Desktop always a mess? This little script tells macOS to not render desktop icons at all, so ~/Desktop is just another folder and your wallpaper is always unobstructed. pic.twitter.com/GjsmbrZ4c4
— Adam Wathan (@adamwathan) July 15, 2019
Read more [twitter.com]
KH. Jebran Ali lists a few cool Laravel tricks
Laravel is full of hidden gems that I have discovered during working on different tasks. Some of these gems were less-known or un-documented features, functions parameters and hacks. In this blog post I will share those hidden gems with you, let’s get started.
Read more [meramustaqbil.com]
#laravel package creators: did you know you can just register your own factories?https://t.co/EHwIoE1VTm pic.twitter.com/zevHhaVh2c
— Freek Van der Herten (@freekmurze) 11 oktober 2018
Tip nr.2 for package creators: you can just use Schema to create tables for your tests.https://t.co/2VO0o2jfiG pic.twitter.com/nXUf7mjxRU
— Freek Van der Herten (@freekmurze) 11 oktober 2018
And another tip: need to use a sqlite in memory db in your orchestra tests? Just set the db connection tot testing in your phpunit config.https://t.co/POtg2N2M4e pic.twitter.com/yE2jtD7CoP
— Freek Van der Herten (@freekmurze) 11 oktober 2018
Read more [twitter.com]
A lesser-known @laravelphp feature: You can define your IDE/editor in your config/app.php file to let the Whoops error handler allow you to open files directly from within the error message. pic.twitter.com/My0BUjTIrM
— Marcel Pociot (@marcelpociot) 10 juli 2018
Read more [twitter.com]
Andrew Schmelyun collected some cool Eloquent niceties.
Over the last year or so, I’ve been collecting and (sometimes) tweeting about methods and helpers I’ve stumbled across in Laravel’s Eloquent ORM. Most of these aren’t that obvious in the documentation, but have made a huge impact as my applications have grown in both size and complexity.
Read more [medium.com]
Martin Hujer shares some pretty good tips for working with Composer.
Although most PHP developers know how to use Composer, not all of them are using it efficiently or in a best possible way. So I decided to summarize things which are important for my everyday workflow.
The philosophy of most of the tips is "Play it safe", which means that if there are more ways how to handle something, I would use the approach which is least error-prone.
https://blog.martinhujer.cz/17-tips-for-using-composer-efficiently/
Today I accidentally committed a multi GB file to the git repo of the project I was working on and pushed it. Damn! Because of that big file cloning the repo again would take a long long time. Removing the file locally and pushing again would not solve the problem as that big file is in Git's history.
So I took a few moments to Google around and learned that that there actually is a git command that can rewrite history: filter-branch. This is how I removed that big file from history:
git filter-branch --tree-filter 'rm path/to/your/bigfile' HEAD
git push origin master --force
Both commands took a while to complete, but after that I had a light repo again.
If you need to do this, be sure to keep a copy of your repo around in case something goes wrong.
Here's an old, but still seemingly still correct blogpost by Dalibor Nasevic with some more info on the subject.
Few weeks ago I froze gems on my blog and ended up with a very big repository. So, I wanted to clean up the mess and remove permanently gems folder from the repository. git rm wasn't doing the job well, it only removes the folder from the working tree and the repository still contains the objects of this folder. After a quick search, I found that git-filter-branch was the command I was looking for.
https://dalibornasevic.com/posts/2-permanently-remove-files-and-folders-from-a-git-repository
One of the first things I do after a fresh setup. That annoyed me for the /longest/ time. pic.twitter.com/j9LvzbMQQd
— Jaggy ? (@jaggygauran) August 31, 2017
Read more [twitter.com]
On the Tighten co blog Caleb Porzio wrote a small post on how you can boot your model traits. It's a very handy feature that's being used a quite a few Spatie packages.
TL;DR Use bootNameOfTrait() instead of boot() in a model trait to avoid being overwritten by the base model’s boot() method.