From 990a9f7ffbbdeb1919858165c3ed02f69d68eeb0 Mon Sep 17 00:00:00 2001 From: Jakub Vyvazil Date: Wed, 11 Oct 2023 12:43:58 +0200 Subject: [PATCH] adds new article + minor changes in old ones --- .../blog/2022/05/global-gitignore/index.md | 39 ++++++++++++++++--- .../06/annotate-doctrine-collections/index.md | 3 +- content/blog/2023/04/new-job/index.md | 17 ++++++++ 3 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 content/blog/2023/04/new-job/index.md diff --git a/content/blog/2022/05/global-gitignore/index.md b/content/blog/2022/05/global-gitignore/index.md index 0a9b148..06361e4 100644 --- a/content/blog/2022/05/global-gitignore/index.md +++ b/content/blog/2022/05/global-gitignore/index.md @@ -1,14 +1,34 @@ -search +--- +title: Do you use a global .gitignore file? Why not? +date: "2022-06-30" +description: "Learn how to use .gitignore files correctly and keep your versioned projects free from unnecessary clutter. This article explains the importance of .gitignore files, identifies common artifacts that should be excluded from versioning, and provides step-by-step instructions for setting up a global .gitignore file to keep your environment clean." +category: "git" +tags: +- git +- gitignore +--- +Every Git user knows about the .gitignore file, but many don't use it correctly. Its purpose is to keep project artifacts out of version control. So what are artifacts? In general, they are all the generated files needed to run the project. For a PHP app, this would typically include the vendor directory, cache, and any generated reports. + +However, I often see a lot of IDE- or OS-specific stuff in .gitignore files, like .DS_STORE. If these files aren't ignored, they can be accidentally versioned in the project, which is not what we want. To prevent this, every developer should set up their environment to not commit their specific files with a global .gitignore. + +To set up a global .gitignore, you first need to be in the versioned directory. If you're not, you can create a temporary directory like this: + +```bash +mkdir ~/Temp +cd ~/Temp +git init +``` +To search for global .gitignore files, you can use this command: +```bash git config --global core.excludesFile +``` -set up - -git config --global core.excludesfile ~/.gitignore - -create +By default, there are no global .gitignore files. To create one, create a .gitignore file with the content you want. Here's an example: +```bash nano ~/.gitignore +``` ```text # Node @@ -26,3 +46,10 @@ Thumbs.db # vi *~ ``` + +Once you have your .gitignore file, you can tell Git to use it globally: + +```bash +git config --global core.excludesfile ~/.gitignore +``` + diff --git a/content/blog/2022/06/annotate-doctrine-collections/index.md b/content/blog/2022/06/annotate-doctrine-collections/index.md index d5686eb..c5dcfc2 100644 --- a/content/blog/2022/06/annotate-doctrine-collections/index.md +++ b/content/blog/2022/06/annotate-doctrine-collections/index.md @@ -1,5 +1,5 @@ --- -title: Phpdoc for Doctrine Collections +title: PHPDoc for Doctrine Collections date: "2022-06-30" description: "Did you ever wonder how to annotate Doctrine Collections with PHPDoc? Check out the syntax!" category: "php" @@ -10,6 +10,7 @@ tags: - annotations --- +When working with collections in PHP entities, it's recommended to use the Doctrine\Common\Collections\Collection interface as a type. This will allow you to use either the ArrayCollection or PersistentCollection implementation, depending on your needs. To properly document your code with PHPDoc, you can use the following syntax: ```php /** @var Collection $articles */ private Collection $articles; diff --git a/content/blog/2023/04/new-job/index.md b/content/blog/2023/04/new-job/index.md new file mode 100644 index 0000000..683e821 --- /dev/null +++ b/content/blog/2023/04/new-job/index.md @@ -0,0 +1,17 @@ +--- +title: New job, new challenges +date: "2023-04-13" +description: "A little something from my life." +category: "personal" +tags: +- career +- imposter syndrome +--- + +For the past few years, I've been working as a contractor for several clients. Although I knew I would have work for the next few months, the tasks were becoming repetitive and not particularly challenging. I realized I had fallen into a comfort zone, which can be a dangerous spot to be in. + +I asked myself what would David Goggins do? And the answer was that I don`t know. He would probably stay hard while running shitload of miles. + +Joining the project has been a roller coaster of emotions. At first, I was hesitant to take on such a big challenge and had doubts about my ability to keep up. But I'm glad I pushed myself out of my comfort zone and took the opportunity. + +It's been tough, but I'm learning so much and enjoying the experience of working with such a talented team. And who knows, maybe now that I'm taking on new challenges and expanding my skills, I'll even have some time to write a few articles for this site! \ No newline at end of file