<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Stefan Cosma</title>
    <description>The latest articles on Forem by Stefan Cosma (@stefanbc).</description>
    <link>https://forem.com/stefanbc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1678%2Ff9b7aa10-b1e5-4f29-a314-12a6db7ce02d.webp</url>
      <title>Forem: Stefan Cosma</title>
      <link>https://forem.com/stefanbc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/stefanbc"/>
    <language>en</language>
    <item>
      <title>The YAGNI principle, as explained by AI.</title>
      <dc:creator>Stefan Cosma</dc:creator>
      <pubDate>Thu, 23 Feb 2023 07:41:34 +0000</pubDate>
      <link>https://forem.com/stefanbc/the-yagni-principle-as-explained-by-ai-42ea</link>
      <guid>https://forem.com/stefanbc/the-yagni-principle-as-explained-by-ai-42ea</guid>
      <description>&lt;h2&gt;
  
  
  The YAGNI principle encourages programmers to only implement features necessary for the current iteration of a project. Focusing on the MVP can reduce complexity, technical debt, and make code easier to maintain and refactor.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1563396983906-b3795482a59a%3Fcrop%3Dentropy%26cs%3Dtinysrgb%26fit%3Dmax%26fm%3Djpg%26ixid%3DMnwxMTc3M3wwfDF8c2VhcmNofDI2fHxyb2JvdHxlbnwwfHx8fDE2NzcxMzc1Nzg%26ixlib%3Drb-4.0.3%26q%3D80%26w%3D2000" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1563396983906-b3795482a59a%3Fcrop%3Dentropy%26cs%3Dtinysrgb%26fit%3Dmax%26fm%3Djpg%26ixid%3DMnwxMTc3M3wwfDF8c2VhcmNofDI2fHxyb2JvdHxlbnwwfHx8fDE2NzcxMzc1Nzg%26ixlib%3Drb-4.0.3%26q%3D80%26w%3D2000" alt="The YAGNI principle, as explained by AI." width="2000" height="1331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The bellow article is an experiment. It was written entirely by an AI to better understand the capabilities, comprehension of user inputs and reliability of current AI language models. Enjoy!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When it comes to software development, it's common for developers to overthink and over-engineer their code. However, sometimes less is more. That's where the YAGNI principle comes in. In this article, we'll take a closer look at what YAGNI is, how it can be applied in JavaScript development, and why it's an essential principle for writing clean, efficient, and effective code.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the YAGNI Principle?
&lt;/h3&gt;

&lt;p&gt;The YAGNI principle is a development principle that encourages developers to only implement features or functionality that are essential to the application's current requirements. In other words, if a feature or functionality is not currently required, there's no need to implement it because, "You Ain't Gonna Need It." YAGNI is closely related to the KISS (Keep It Simple, Stupid) principle, which advocates for simplicity and clarity in code over complexity and cleverness.&lt;/p&gt;

&lt;h3&gt;
  
  
  How YAGNI can be applied in JavaScript?
&lt;/h3&gt;

&lt;p&gt;The YAGNI principle can be applied in every stage of the software development process, from planning and design to implementation and testing. In practice, this means developers should only implement the features that are necessary to meet the current requirements of the application. This allows developers to avoid overcomplicating their codebase with unnecessary or premature functionality.&lt;/p&gt;

&lt;p&gt;To see YAGNI in action, let's consider an example. Suppose we're building a simple web application that allows users to register and login. Here's some code that violates the YAGNI principle:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiqfziurasuisb2ni0f5n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiqfziurasuisb2ni0f5n.png" alt="The YAGNI principle, as explained by AI." width="800" height="911"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this example, we have a &lt;code&gt;User&lt;/code&gt; class with a large number of fields and methods, many of which may not be needed in the current version of the application. For example, &lt;code&gt;isDeleted&lt;/code&gt; and &lt;code&gt;updateProfile&lt;/code&gt; may not be essential at this stage of development. The result is an overly complex and difficult to maintain codebase.&lt;/p&gt;

&lt;p&gt;A better implementation of the &lt;code&gt;User&lt;/code&gt; class would be to only include the essential fields and methods required for the current version of the application. Here's a YAGNI-compliant implementation of the &lt;code&gt;User&lt;/code&gt; class:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vjg2cemfhcoobiqm8wz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vjg2cemfhcoobiqm8wz.png" alt="The YAGNI principle, as explained by AI." width="800" height="888"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this implementation, we only include the fields and methods that are necessary for registering, logging in, and logging out users. This results in a simpler, more maintainable codebase that's easier to read and understand.&lt;/p&gt;

&lt;p&gt;The YAGNI principle is an essential development principle for writing clean, efficient, and effective code. By only implementing the features and functionality that are essential for the current requirements of the application, developers can avoid overcomplicating their codebase with unnecessary or premature functionality. By applying YAGNI in JavaScript development, developers can create a simpler, more maintainable codebase that's easier to read and understand.&lt;/p&gt;




&lt;p&gt;As we can see in the above text, the AI managed to do a pretty good job in explaining the YAGNI concept, but as any good AI language model that uses advanced machine learning algorithms, it needs a really good input so that it can return the most accurate result. With that in mind, these "magical" tools that popped up on everyones radar, since Nov 2022, are becoming increasingly better at understanding user inputs and generating the appropriate responses.&lt;/p&gt;

&lt;p&gt;What are your thoughts on the matter? I would love to hear them.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>robots</category>
      <category>singularity</category>
    </item>
    <item>
      <title>How To: Interview a developer, as a developer!</title>
      <dc:creator>Stefan Cosma</dc:creator>
      <pubDate>Thu, 10 Nov 2022 09:14:13 +0000</pubDate>
      <link>https://forem.com/stefanbc/how-to-interview-a-developer-as-a-developer-p4m</link>
      <guid>https://forem.com/stefanbc/how-to-interview-a-developer-as-a-developer-p4m</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1487017159836-4e23ece2e4cf%3Fcrop%3Dentropy%26cs%3Dtinysrgb%26fit%3Dmax%26fm%3Djpg%26ixid%3DMnwxMTc3M3wwfDF8c2VhcmNofDExOHx8ZGV2ZWxvcGVyfGVufDB8fHx8MTY2ODAwMDAzOQ%26ixlib%3Drb-4.0.3%26q%3D80%26w%3D2000" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1487017159836-4e23ece2e4cf%3Fcrop%3Dentropy%26cs%3Dtinysrgb%26fit%3Dmax%26fm%3Djpg%26ixid%3DMnwxMTc3M3wwfDF8c2VhcmNofDExOHx8ZGV2ZWxvcGVyfGVufDB8fHx8MTY2ODAwMDAzOQ%26ixlib%3Drb-4.0.3%26q%3D80%26w%3D2000" alt="How To: Interview a developer, as a developer!" width="2000" height="1333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Author note: This article focuses on the interview process for a Frontend position and was inspired by a post, I interacted with, on LinkedIn.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You now have a new responsibility within your company. The HR/Recruiting department needs your help in assessing candidates, for a technical position within your company. Luckily they've come to the right person because they know you have the soft skills and technical expertise to do just that.&lt;/p&gt;

&lt;p&gt;But you, a senior developer, know nothing about interviewing other developers. Fortunately, for you, there are several resources on the web that can help you with that. From using &lt;a href="https://www.codinginterview.com/" rel="noopener noreferrer"&gt;CodingInterview.com&lt;/a&gt; as a basis for your interview or requiring that the candidates finish a certain challenge on &lt;a href="https://leetcode.com/" rel="noopener noreferrer"&gt;LeetCode.com&lt;/a&gt;, there are multiple ways you can create your process of assessment. You could even use this &lt;a href="https://t3-tools.notion.site/Technical-Interview-Dan-Abramov-9aa6d8e9292e4bd1ae67b44aeeaabf88" rel="noopener noreferrer"&gt;great article&lt;/a&gt; as a starting point.&lt;/p&gt;

&lt;p&gt;Of course, if you work in a big tech company there is a procedure for coding interviews. Still if you work for a small company then most probably that procedure is missing and you have to help the Recruiting department implement it.&lt;/p&gt;

&lt;h2&gt;
  
  
  My approach
&lt;/h2&gt;

&lt;p&gt;Below is my process, for assessing the knowledge of a candidate. I have "perfected" this approach throughout many many interviews.&lt;/p&gt;

&lt;p&gt;Since I'm not interested in the recruitment part, I assume that the candidate has already been screened by the Recruiting department, so depending on the time allotted for the technical interview, I structure the discussion so that it does not exceed more than 1 hour. I receive in advance a resume and hopefully a public Github or some VCS, to look over some code written by the candidate.&lt;/p&gt;

&lt;p&gt;If the person is of Senior level, then it is more a technical discussion rather than a coding interview. So far, from what I have experienced, a Senior level candidate not knowing what they are talking about has never happened, but it doesn't mean it will never happen.&lt;/p&gt;

&lt;p&gt;If they are of Junior or Regular level, then the coding interview process begins.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setup
&lt;/h3&gt;

&lt;p&gt;I use Notion (which is a great tool by the way), where I have the whole process structured on several pages. This includes a database for evaluation (I don't store any personal data, I score the candidate from 1 to 5, set a skill level, type of focus: Frontend, Backend, FullStack, and finally some notes), technical questions for different programming languages (usually JavaScript and PHP), frameworks and lastly coding challenges that help me in determining the candidate's ability to solve a problem or if they can explain a particular solution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Process
&lt;/h3&gt;

&lt;p&gt;The whole discussion is very informal. I start by asking the candidate what tools, frameworks, and libraries they use and what they prefer to focus more on: frontend or backend. I ask these things so that I can get an idea of ​​what the person knows, not what is written in the resume, since we all know that resumes are sometimes bloated and because I want to know if the person might be a good fit with one or more of the ongoing projects within the company.&lt;/p&gt;

&lt;p&gt;As I mentioned at the beginning of the article, the interview is for a Frontend position, so depending on the above answers, I either start with basic JavaScript questions, and depending on the resume we go through questions about Angular / Vue / React, move on to CSS, or start with questions about PHP, databases, and OOP. Finally, I ask about a VCS, usually about Git.&lt;/p&gt;

&lt;p&gt;Here is an example of a fundamental JavaScript question I usually ask in interviews:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frx6jqjc9qz8pxu4b60hi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frx6jqjc9qz8pxu4b60hi.png" alt="How To: Interview a developer, as a developer!" width="800" height="606"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another question I could ask is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What is the difference between undefined and not defined in JavaScript?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here is a &lt;a href="https://itnext.io/the-difference-between-undefined-and-not-defined-in-javascript-db4c79949be6" rel="noopener noreferrer"&gt;great article&lt;/a&gt; explaining this.&lt;/p&gt;

&lt;p&gt;If I can't form an educated opinion about the candidate, since the above questions were language focused, I can switch to more agnostic things like Data Structures or Algorithms. Depending on the candidate's skill level I could also ask about stuff like Hoisting, Closures, or &lt;a href="https://dev.to/denisveleaev/5-solid-principles-with-javascript-how-to-make-your-code-solid-1kl5"&gt;SOLID&lt;/a&gt;. If they focus more on the Backend, then I could be asking about stuff like Singletons, Prototypes, or even deadlocks.&lt;/p&gt;

&lt;p&gt;The above was more theoretical, now I move on to ask practical code questions.&lt;/p&gt;

&lt;p&gt;I start by showing the candidate a piece of code and ask them to solve a certain problem for me, and I make sure to mention that they can write pseudocode, because I'm more interested in assessing analogical reasoning, problem-solving rather than exact code, my reason being that the time allotted for the interview might not permit it and also:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Remember - the goal isn't to see how fast they write the right answer. I'm trying to learn about how they work and communicate.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here is an example of a problem I would be asking, in an interview:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhycmy3mrvh4d116c140h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhycmy3mrvh4d116c140h.png" alt="How To: Interview a developer, as a developer!" width="800" height="850"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If they know how to solve the above problem, then it's all good, if not, I propose several solutions and ask them to explain how they work. This will allow me to understand their "train of thought" from start to end.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;If the candidate doesn't know about a certain paradigm/concept or how to solve a practical problem, I try to briefly explain it, if the time allows it. I do this because the person is already stressed and I try to leave them with more knowledge than they came in with.&lt;/p&gt;

&lt;p&gt;If there is still a need after the coding interview session, I have prepared some homework, for example: develop a small app with whatever frameworks, or libraries they want, put it on a public VCS, &lt;a href="https://codesandbox.io/" rel="noopener noreferrer"&gt;CodeSandbox&lt;/a&gt;, or &lt;a href="https://stackblitz.com/" rel="noopener noreferrer"&gt;StackBlitz&lt;/a&gt; so that I can evaluate it and see that it works correctly.&lt;/p&gt;

&lt;p&gt;After the interview session is over, I provide feedback to the recruiter in a short, concise email, that covers all the assessed points.&lt;/p&gt;

&lt;p&gt;This is my interview process. I know it's not perfect but so far it seems it got the job done and I helped in hiring some great developers. Please feel free to point out any flaws you might see in this approach or if you have any feedback you can find me at &lt;a href="https://twitter.com/stefanbc" rel="noopener noreferrer"&gt;@stefanbc&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>howto</category>
      <category>interview</category>
      <category>developers</category>
      <category>coding</category>
    </item>
    <item>
      <title>Cleaning up Plex with Google Scripts</title>
      <dc:creator>Stefan Cosma</dc:creator>
      <pubDate>Fri, 29 May 2020 19:02:38 +0000</pubDate>
      <link>https://forem.com/stefanbc/cleaning-up-plex-with-google-scripts-12i9</link>
      <guid>https://forem.com/stefanbc/cleaning-up-plex-with-google-scripts-12i9</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1461151304267-38535e780c79%3Fixlib%3Drb-1.2.1%26q%3D80%26fm%3Djpg%26crop%3Dentropy%26cs%3Dtinysrgb%26w%3D2000%26fit%3Dmax%26ixid%3DeyJhcHBfaWQiOjExNzczfQ" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1461151304267-38535e780c79%3Fixlib%3Drb-1.2.1%26q%3D80%26fm%3Djpg%26crop%3Dentropy%26cs%3Dtinysrgb%26w%3D2000%26fit%3Dmax%26ixid%3DeyJhcHBfaWQiOjExNzczfQ" alt="Cleaning up Plex with Google Scripts"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just as the title implies, this tutorial is going to cover what it takes to automatically cleanup a Plex media server, using Google Scripts. I am aware there are other ways to do this, but this tutorial is tailored specifically for Google Scripts.&lt;/p&gt;

&lt;p&gt;Table of contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setup&lt;/li&gt;
&lt;li&gt;Code&lt;/li&gt;
&lt;li&gt;Execution&lt;/li&gt;
&lt;li&gt;Notifications&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;Head over to the &lt;a href="https://script.google.com/" rel="noopener noreferrer"&gt;Google Script dashboard&lt;/a&gt; and create a new project. Before we start writing any piece of code we need some prerequisites, for our project.&lt;/p&gt;

&lt;p&gt;Open the &lt;strong&gt;View&lt;/strong&gt; menu and click on &lt;strong&gt;Show manifest file&lt;/strong&gt;. This will allow us to add dependencies and other scripts to our project. Now you can open the &lt;strong&gt;appscript.json&lt;/strong&gt; file and add this line before the last &lt;strong&gt;}&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"oauthScopes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"https://www.googleapis.com/auth/script.external_request"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This line gives us the ability to make external requests from our script to the Plex media server.&lt;/p&gt;

&lt;p&gt;After adding the line above, open the &lt;strong&gt;File&lt;/strong&gt; menu and click on &lt;strong&gt;Project properties&lt;/strong&gt; and open the &lt;strong&gt;Script properties&lt;/strong&gt; tab. You will need to add multiple key/value properties.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;TOKEN&lt;/li&gt;
&lt;li&gt;BASE_URL&lt;/li&gt;
&lt;li&gt;IFTTT_WEBHOOK&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The last one is optional and we will cover it in the last point of this tutorial.&lt;/p&gt;

&lt;p&gt;I'll start with number 2, which represents the Plex media server base URL. The server needs to be accessible via the Internet or else our script won't work at all. For point number 1 you'll need to do a bit of digging.&lt;/p&gt;

&lt;p&gt;In Plex, open the page of any piece of media (this represents the last child of that media, whether it's a show or a movie). Next to the Edit button you should see three dots. Clicking on those should open a menu like in the bellow picture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2020%2F05%2FS9iWhy1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2020%2F05%2FS9iWhy1.png" alt="Cleaning up Plex with Google Scripts"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;Get Info&lt;/strong&gt; and then in the modal that pops up, in the bottom left click on &lt;strong&gt;View XML&lt;/strong&gt;. This will open the media metadata in the form of XML, in a new tab. From the URL of that tab you can extract the &lt;strong&gt;X-Plex-Token&lt;/strong&gt; which coincidentally is the last parameter in the URL.&lt;/p&gt;

&lt;p&gt;After we have points 1 and 2 we can start writing the actual code, for our script.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;I'll paste the code in it's entirety and then we can go over it line by line.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Gets the script properties&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;PropertiesService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getScriptProperties&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
      &lt;span class="nx"&gt;baseURL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;BASE_URL&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="nx"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;TOKEN&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="nx"&gt;webhook&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;IFTTT_WEBHOOK&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="nx"&gt;section&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Main constructor method&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;UrlFetchApp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;baseURL&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/library/sections/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;section&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/allLeaves`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;X-Plex-Token&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="nx"&gt;jsonObject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;xmlToJson&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getContentText&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
    &lt;span class="nx"&gt;videoContainer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;jsonObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MediaContainer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Video&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;videoContainer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;watchedVideos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isArray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;videoContainer&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;watchedVideos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;videoContainer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;viewCount&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;videoContainer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;viewCount&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;watchedVideos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;videoContainer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;watchedVideos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;watchedTitles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

      &lt;span class="nx"&gt;watchedVideos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="nx"&gt;UrlFetchApp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;baseURL&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DELETE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;X-Plex-Token&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;

        &lt;span class="c1"&gt;// Notifications&lt;/span&gt;
        &lt;span class="nx"&gt;watchedTitles&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;grandparentTitle&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; - &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;watchedTitles&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\r\n&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;watchedVideos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nx"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;watchedTitles&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
          &lt;span class="nx"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Notification sent!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

          &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;notification&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
            &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;watchedVideos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; watched episodes were removed!`&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
            &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\r\n&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
            &lt;span class="nx"&gt;watchedTitles&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

          &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;contentType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;value1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;notification&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
          &lt;span class="p"&gt;};&lt;/span&gt;
          &lt;span class="nx"&gt;UrlFetchApp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;webhook&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;No videos to delete!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This first things we need to get are the script properties we setup in the first step, of this tutorial.&lt;/p&gt;

&lt;p&gt;Notice there is a variable called &lt;strong&gt;section&lt;/strong&gt;. That represents the ID of the library in the Plex media server. You can get that, by opening the desired library you want to clean and from the URL get the value from the &lt;strong&gt;source&lt;/strong&gt; parameter (hint: it should be the last one).&lt;/p&gt;

&lt;p&gt;Next up, we start building the actual function that does the cleaning up.&lt;/p&gt;

&lt;p&gt;Using the &lt;strong&gt;UrlFetchApp&lt;/strong&gt; library and the fetch method we call the Plex media server to retrieve all the contents of our library. We parse the XML response to JSON using a method that you can find &lt;a href="https://gist.github.com/stefanbc/2b607c77961d42532043da1ee48d84d1#file-utilities-gs" rel="noopener noreferrer"&gt;here&lt;/a&gt;. You can add the parsing method to the same file, if you want.&lt;/p&gt;

&lt;p&gt;If the &lt;strong&gt;videoContainer&lt;/strong&gt; object was correctly parsed we need to check its type, because Plex will return an object if there is only one child in the library, instead of an array of objects. We're going to check for the &lt;strong&gt;viewCount&lt;/strong&gt; if it's true and add everything we find to an array of objects.&lt;/p&gt;

&lt;p&gt;While iterating through the whole array, we make a &lt;strong&gt;DELETE&lt;/strong&gt; type call to the Plex media server, passing the &lt;strong&gt;TOKEN&lt;/strong&gt; , in the headers, and using the &lt;strong&gt;baseURL&lt;/strong&gt; and &lt;strong&gt;videoKey&lt;/strong&gt; as the URL for our call.&lt;/p&gt;

&lt;p&gt;That's it. You can run the script by clicking the Run icon and the checking the logs in the View menu. You should see a list of all the items deleted.&lt;/p&gt;

&lt;h2&gt;
  
  
  Execution
&lt;/h2&gt;

&lt;p&gt;We can automate this script to run at certain times in the day. We can do this by setting a trigger.&lt;/p&gt;

&lt;p&gt;In order to set a trigger, open the &lt;strong&gt;Edit&lt;/strong&gt; menu and click &lt;strong&gt;Current project's triggers&lt;/strong&gt; and add a new trigger. Bellow is an example of how you could set it up.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2020%2F05%2FbdSYBL2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2020%2F05%2FbdSYBL2.png" alt="Cleaning up Plex with Google Scripts"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There's no need to run it too often if you don't watch a lot of shows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Notifications
&lt;/h2&gt;

&lt;p&gt;This step is optional, so you don't have to follow it. I wanted a way to get notified if the script ran and what items were deleted from Plex.&lt;/p&gt;

&lt;p&gt;I decided I was going to use IFTTT but you can use Zapier, Automate.io or even one of Google services to send an email.&lt;/p&gt;

&lt;p&gt;The code is rather simple for IFTTT. You can find it bellow&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Notifications&lt;/span&gt;
&lt;span class="nx"&gt;watchedTitles&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;grandparentTitle&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; - &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;watchedTitles&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\r\n&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;watchedVideos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;watchedTitles&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Notification sent!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;notification&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
        &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;watchedVideos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; watched episodes were removed!`&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\r\n&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
        &lt;span class="nx"&gt;watchedTitles&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;contentType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;value1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;notification&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="nx"&gt;UrlFetchApp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;webhook&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add this code inside the iteration (after the &lt;strong&gt;DELETE&lt;/strong&gt; call. It's already in the code I shared above). This will create an array of media titles and send them to a webhook in IFTTT that has a recipe set up to send a notification to my phone. You can customise it however you like.&lt;/p&gt;

&lt;p&gt;Some points before I end this tutorial:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;This project is running on the new Apps Script runtime powered by Chrome V8&lt;/li&gt;
&lt;li&gt;If you have any ideas on how to improve the script let me know.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's it. You can also find the code &lt;a href="https://gist.github.com/stefanbc/2b607c77961d42532043da1ee48d84d1" rel="noopener noreferrer"&gt;here&lt;/a&gt; and if you have any questions let me know. You can reach me on most social media channels.&lt;/p&gt;

</description>
      <category>howto</category>
      <category>tutorials</category>
      <category>googlescripts</category>
      <category>plex</category>
    </item>
    <item>
      <title>Run Ghost inside a Docker container on DigitalOcean</title>
      <dc:creator>Stefan Cosma</dc:creator>
      <pubDate>Mon, 01 Apr 2019 20:13:39 +0000</pubDate>
      <link>https://forem.com/stefanbc/run-ghost-inside-a-docker-container-on-digitalocean-3m1a</link>
      <guid>https://forem.com/stefanbc/run-ghost-inside-a-docker-container-on-digitalocean-3m1a</guid>
      <description>&lt;p&gt;Recently I created a new theme for Ghost, that you can find &lt;a href="https://github.com/stefanbc/Asgar"&gt;here&lt;/a&gt; and can currently experience on my &lt;a href="https://stefancosma.xyz"&gt;website&lt;/a&gt;. I wanted a way of showing it off, so anyone that wants to contribute to it or just plain use it, can get a feel of what it looks like in a live environment.&lt;/p&gt;

&lt;p&gt;Initially I looked at Heroku, but I soon fell into a rabbit hole of errors, because Docker doesn't play nice with Heroku and I didn't like that I would have to jump through hoops just to keep the app online. Keep in mind that this is an open source project and having to pay for keeping the Heroku app was not something I was prepared to do at that moment.&lt;/p&gt;

&lt;p&gt;But, Stefan, you already have a server, where you host your website! Why don't you use that? Initially, I wanted to keep my server clean off other systems and just use it for my website. I changed my mind and here we are.&lt;/p&gt;

&lt;p&gt;Enough backstory, let's get to the actual implementation. Bellow is my current stack and the process I followed that works for my setup. It may work differently for you and your stack.&lt;/p&gt;

&lt;p&gt;My whole stack is like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I have the &lt;code&gt;stefancosma.xyz&lt;/code&gt; domain registered and I use Cloudflare as a DNS provider.&lt;/li&gt;
&lt;li&gt;The website itself is hosted on a DigitalOcean droplet, that runs their Ghost image (an older version but I keep it up to date).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Nothing fancy, right?&lt;/p&gt;

&lt;p&gt;So, the first thing I did was to get Docker working on my droplet. After running &lt;code&gt;apt-get update&lt;/code&gt; I installed Docker using this:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apt-get install docker.io
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Once that was done, I just spun up a new Docker container for Ghost. Luckily there is already a Docker image for Ghost. You can check it out &lt;a href="https://hub.docker.com/_/ghost"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now the tricky part. I ran this command to expose the Ghost instance in the Docker container, to the outside world.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -d --name name_your_container -p 3001:2368 -e url=https://ghost_url ghost
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;So, what this command does, is that it runs a new container with a custom name and it exposes the Ghost port &lt;code&gt;2368&lt;/code&gt; on the host's &lt;code&gt;3001&lt;/code&gt; port. Of course you can use a different port on your machine, if you so desire. Another cool thing is that this Docker image accepts, as parameters, any Ghost configuration parameters, found &lt;a href="https://docs.ghost.org/concepts/config/"&gt;here&lt;/a&gt;. The Docker image name is &lt;code&gt;ghost&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So now, if you access your droplets IP followed by the &lt;code&gt;3001&lt;/code&gt; port, you should see a new Ghost instance up and running.&lt;/p&gt;

&lt;p&gt;The last thing I did was to spin up a new subdomain inside Nginx and add it to Cloudflare. The configuration I used for Nginx is similar to the one bellow:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name subdomain.domain.com;

    ssl_certificate certificate.cert;
    ssl_certificate_key key.key;
    include conf.conf;

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_pass http://127.0.0.1:3001;

    }

    location ~ /.well-known {
        allow all;
    }

    client_max_body_size 50m;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Besides the above configuration, I've added a CNAME record with the subdomain name that points to the root domain.&lt;/p&gt;

&lt;p&gt;And that's it. All good and done.&lt;/p&gt;

&lt;p&gt;Nothing out of the ordinary. How would you have done it differently? Tweet &lt;a href="https://twitter.com/stefanbc"&gt;@stefanbc&lt;/a&gt; or email me &lt;a href="mailto:hello@stefancosma.xyz"&gt;hello@stefancosma.xyz&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Until next time, code long and prosper.&lt;/p&gt;

</description>
      <category>howto</category>
      <category>tutorials</category>
      <category>digitalocean</category>
      <category>ghost</category>
    </item>
    <item>
      <title>How To: Organise a web developer meetup</title>
      <dc:creator>Stefan Cosma</dc:creator>
      <pubDate>Fri, 23 Nov 2018 18:00:00 +0000</pubDate>
      <link>https://forem.com/stefanbc/how-to-organise-a-web-developer-meetup-4cf7</link>
      <guid>https://forem.com/stefanbc/how-to-organise-a-web-developer-meetup-4cf7</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2018%2F11%2Fparadise.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2018%2F11%2Fparadise.gif" alt="How To: Organise a web developer meetup" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclaimer: This post was automatically published a few hours after the event so let's hope everything went according to plan.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I recently had the opportunity to organise a meetup, that revolved around the idea of knowledge exchange and community building. I've had this idea for a very long time. Ever since I was working with the team over &lt;a class="mentioned-user" href="https://dev.to/koding"&gt;@koding&lt;/a&gt;, where I helped grow the community and before that, when I was in collage, because I couldn't find any clubs or meetups of like minded people around my hometown.&lt;/p&gt;

&lt;p&gt;But you may ask why a real life event, instead of creating an online community? Because when you're meeting people face to face you have a better understanding of what they're trying to communicate with you, whether it's feelings of disagreement or just want to share knowledge with you.&lt;/p&gt;

&lt;p&gt;This was my first time organising an irl event. Bellow are the steps I followed when I organised the &lt;a href="https://meetup.com/sibiu-web-meetup" rel="noopener noreferrer"&gt;Sibiu Web Meetup&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Overview
&lt;/h3&gt;

&lt;p&gt;In the case of the meetup I organised, I wanted it to be free, with limited seats (because, well, it's not a conference), for anyone interested in web development, web design and all other web related topics. All skill levels are welcome, this includes students, juniors and senior devs. It should be a meetup that revolves around the idea of knowledge exchange and community building. Also this could be a monthly meetup or every two months (still haven't decided on this aspect).&lt;/p&gt;

&lt;p&gt;When you start putting the event together, make sure you inform your attendees about all the things that you want to achieve with your meetup and share as much details as possible (when, where and why).&lt;/p&gt;

&lt;h3&gt;
  
  
  Details
&lt;/h3&gt;

&lt;p&gt;Now let's talk about the actual details of organising a meetup.&lt;/p&gt;

&lt;p&gt;The first thing I did, was to see if anyone wanted to talk about the web, at a local meetup. Luckily I have some friends that have held talks in the past and have extensive knowledge about the web. I presented the idea and told them that they're free to talk about anything web related and after some proposals, we came to some consensus on what the talks should be about.&lt;/p&gt;

&lt;p&gt;Ok, talks, checked. Now I needed a place to host the meetup. Enter the local university, that was more the gracious into providing a room for the meetup and as an added bonus the students from the Computer Science major would be invited and would get a chance to meet professional developers and gain some knowledge from the field, something I didn't have when I was in collage. Students being able to connect with professional developers is something beneficial to both parties. On one hand the students learn something new and on the other hand professional developers get to share their knowledge with someone else. I know you can find people online that are more than willing to help out but it's something different when you actually meet someone in person.&lt;/p&gt;

&lt;p&gt;Place, checked. It was now time to let people know about the meetup. So a small social media campaign was started. This included sharing on all the social media channels and printing some ads for the university to use, so that students could find out about the event. In terms of attendance, I wanted it to be a small gathering of people, not a full fledged event, like a conference might be. If you let them know about the event they will come, even if it's just out of curiosity.&lt;/p&gt;

&lt;p&gt;Bellow is a checklist that I've put together, with ideas that I implemented for the meetup, things that you should not forget about, when organising an event.&lt;/p&gt;

&lt;h3&gt;
  
  
  Speakers
&lt;/h3&gt;

&lt;p&gt;The most important aspect of the whole event.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;3 speakers - with ~30 min max per talk + QA session. &lt;/li&gt;
&lt;li&gt;Diverse panel of speakers.&lt;/li&gt;
&lt;li&gt;1 host - to keep everything in check.&lt;/li&gt;
&lt;li&gt;2 hour time frame - have a break after the first two speakers.&lt;/li&gt;
&lt;li&gt;Networking with the speakers at the end of the meetup.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Place
&lt;/h3&gt;

&lt;p&gt;Any place is a good place. If it's sunny and warm you can have it outside.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Find a classroom at your local University, a co-working space or even your local pub or cafe. Start small and grow.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Attendance
&lt;/h3&gt;

&lt;p&gt;Make sure that the people who attend are the actual target audience, people that can actually help you into building a community and share knowledge.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maximum of 30 places. Make sure you have the possibility of growing based on popularity.&lt;/li&gt;
&lt;li&gt;Students have priority. Because we want as many of them to actually learn something from the professionals.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Social media marketing
&lt;/h3&gt;

&lt;p&gt;The more people know about it, the larger the community and the more knowledge is exchanged.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Promote on LinkedIn, Twitter, Facebook (Instagram), Reddit etc. Create an easy to remember hashtag and create a Facebook event. Also don't forget to choose a cool title for your meetup.&lt;/li&gt;
&lt;li&gt;The social media marketing process will be a collaboration between the parts involved. Get you attendees to share the event if they want to do so.&lt;/li&gt;
&lt;li&gt;Use &lt;a href="https://meetup.com" rel="noopener noreferrer"&gt;meetup.com&lt;/a&gt; as a platform to organise everything.&lt;/li&gt;
&lt;li&gt;Use &lt;a href="https://speakerdeck.com" rel="noopener noreferrer"&gt;speakerdeck.com&lt;/a&gt; to host the presentations.&lt;/li&gt;
&lt;li&gt;[Optional] Setup a weekly newsletter with useful web links.&lt;/li&gt;
&lt;li&gt;[Optional] Print and pass QR stickers around with a link to the event.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Extra
&lt;/h3&gt;

&lt;p&gt;Anything that can improve the whole experience for everyone.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creation of a Slack group to share extra knowledge and ask the pros for help with certain areas. Pro-bono mentoring program through Slack.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I want to wrap this app with just a few mentions.&lt;/p&gt;

&lt;p&gt;Choose the topics very carefully and try to keep them interesting. Ask the attendees if some of them want to host a talk at the next gathering. Plan your next meetup before the current one takes place. Make sure you choose an easy to remember title for your meetup. And lastly make sure everyone has fun.&lt;/p&gt;

&lt;p&gt;If you have any other ideas that you've implemented at your meetups, do let me know &lt;a href="https://twitter.com/stefanbc" rel="noopener noreferrer"&gt;@stefanbc&lt;/a&gt;, I would love to hear them.&lt;/p&gt;

&lt;p&gt;Until next time, code long and prosper!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Image credit: &lt;a href="http://guillaumekurkdjian.com/" rel="noopener noreferrer"&gt;Guillaume Kurkdjian&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>developers</category>
      <category>meetup</category>
      <category>community</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How To: Use Tomcat in Intellij IDEA Community</title>
      <dc:creator>Stefan Cosma</dc:creator>
      <pubDate>Mon, 01 Oct 2018 11:31:20 +0000</pubDate>
      <link>https://forem.com/stefanbc/how-to-use-tomcat-in-intellij-idea-community-p07</link>
      <guid>https://forem.com/stefanbc/how-to-use-tomcat-in-intellij-idea-community-p07</guid>
      <description>&lt;p&gt;Recently I started working on a project that required me to have the backend part installed locally, instead of using a remote backend. The project uses Maven as a build tool and it deploys the code to a Tomcat server.&lt;/p&gt;

&lt;p&gt;I got cracking and started configuring the project on my local machine. The first thing I noticed is that Intellij IDEA Community does not have a Tomcat plugin, unlike the Ultimate edition, that has one out of the box.&lt;/p&gt;

&lt;p&gt;Many Google searches later I found a few plugins that might do the trick but when I tried using them, the famous NullPointerException happened and I started looking for an alternative. I found some inspiration on Github, but not in the form I wanted, but it was good enough to get me started.&lt;/p&gt;

&lt;p&gt;Bellow is a short tutorial on how to setup Tomcat in Intellij IDEA Community to run/debug, and how to use Maven to build your project and then deploy it to Tomcat.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Install Intellij IDEA Community.&lt;/li&gt;
&lt;li&gt;Install Tomcat - For my project I've used Tomcat 8. You can get it from &lt;a href="https://tomcat.apache.org/download-80.cgi" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Install Maven.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tomcat Configuration
&lt;/h2&gt;

&lt;p&gt;Make sure you install Tomcat in a place that doesn't require admin access, for example next to your project.&lt;/p&gt;

&lt;p&gt;After that, open &lt;code&gt;File -&amp;gt; Settings&lt;/code&gt; and expand &lt;code&gt;Tools&lt;/code&gt; and select &lt;code&gt;External Tools&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You can add a new tool with whatever name you want. I named mine, Tomcat. For tool settings, select the &lt;code&gt;catalina.bat&lt;/code&gt; file, usually located in the &lt;code&gt;bin&lt;/code&gt; folder of your Tomcat installation. For example mine is &lt;code&gt;C:\apache-tomcat-8.5.34\bin\catalina.bat&lt;/code&gt;. And last but not least set an argument with the command &lt;code&gt;jpda run&lt;/code&gt;. The working directory should be set automatically.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2018%2F10%2Fn90GnDc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2018%2F10%2Fn90GnDc.png" width="800" height="400"&gt;&lt;/a&gt;Tomcat External Tool&lt;/p&gt;

&lt;h2&gt;
  
  
  Start Tomcat
&lt;/h2&gt;

&lt;p&gt;If you go to &lt;code&gt;Tools -&amp;gt; External Tools&lt;/code&gt; and click on Tomcat, it should start the Tomcat server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Maven build and deploy to Tomcat
&lt;/h2&gt;

&lt;p&gt;Now that you're done with the Tomcat configuration you want the ability to build using Maven and deploy to the now working Tomcat server.&lt;/p&gt;

&lt;p&gt;To achieve this you'll need to head over to &lt;code&gt;Run -&amp;gt; Edit Configurations&lt;/code&gt;, click the "+" and select &lt;code&gt;Maven&lt;/code&gt;. Don't forget to name your new configuration. Select your project location and add the following command line.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;war:war org.codehaus.mojo:wagon-maven-plugin:upload-single -Dwagon.fromFile=D:\work\project\backend.war -Dwagon.url=file://C:\apache-tomcat-8.5.34\webapps\
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What this line does is that it builds the project, using Maven, and then gets the file from the specified path (that's usually configured in your project) and copies it to the &lt;code&gt;webapps&lt;/code&gt; folder in Tomcat. Tomcat then knows it has a new version of the file and redeploys it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2018%2F10%2Fp1AH4PH.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2018%2F10%2Fp1AH4PH.png" width="800" height="400"&gt;&lt;/a&gt;Build and deploy to Tomcat&lt;/p&gt;

&lt;h2&gt;
  
  
  Tomcat Remote Debug
&lt;/h2&gt;

&lt;p&gt;Like all applications you want the ability to debug your backend. To achieve this you'll need to add a new configuration like the previous step. The only difference this time is that when you click "+" you'll need to select &lt;code&gt;Remote&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Give your configuration a name. You'll need to set the Debugger mode to &lt;code&gt;Attach to remote JVM&lt;/code&gt;, the Transport to &lt;code&gt;Socket&lt;/code&gt;, the Host to &lt;code&gt;localhost&lt;/code&gt; and lastly the Port to &lt;code&gt;8000&lt;/code&gt;. That way when you start the configuration, Intellij will connect via Socket to the Tomcat server that emits via port &lt;code&gt;8000&lt;/code&gt;. You can change the port for Tomcat, to something else, in the Tomcat &lt;code&gt;server.xml&lt;/code&gt; file, in the config folder.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2018%2F10%2F0sqI0hD.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2018%2F10%2F0sqI0hD.png" width="800" height="400"&gt;&lt;/a&gt;Tomcat Remote Debug&lt;/p&gt;

&lt;p&gt;Once the Tomcat server is started you can run this configuration. Just click on &lt;code&gt;Run -&amp;gt; Debug&lt;/code&gt; and then select the newly created configuration.&lt;/p&gt;

&lt;p&gt;If you want to keep a record of all the logs when debugging, you can achieve this by going to the Logs tabs in the newly created Remote configuration and set the Save console output to file to the &lt;code&gt;logs&lt;/code&gt; folder of your Tomcat installation. In my case it was &lt;code&gt;C:\apache-tomcat-8.5.34\logs*.*&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2018%2F10%2FBSxR11Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2018%2F10%2FBSxR11Q.png" width="800" height="400"&gt;&lt;/a&gt;Tomcat Remote Debug Logs&lt;/p&gt;

&lt;p&gt;That is it. @ me on Twitter if you think I've missed something or if there is another way of doing this without installing Eclipse or purchasing the Ultimate edition of Intellij IDEA.&lt;/p&gt;

&lt;p&gt;Until next time, code long and prosper!&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>java</category>
      <category>tomcat</category>
      <category>intellij</category>
    </item>
    <item>
      <title>Visual Studio Code - Tips &amp; Tricks</title>
      <dc:creator>Stefan Cosma</dc:creator>
      <pubDate>Sun, 08 Jan 2017 15:13:54 +0000</pubDate>
      <link>https://forem.com/stefanbc/visual-studio-code---tips--tricks</link>
      <guid>https://forem.com/stefanbc/visual-studio-code---tips--tricks</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2017%2F01%2F5.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2017%2F01%2F5.gif" alt="Visual Studio Code - Tips &amp;amp; Tricks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're following me on Twitter you probably know how much I enjoy using Microsoft's Visual Studio Code. So much, that one of my tweets is currently featured on their &lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;main page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But this article is not about how much I enjoy my code editor, it's about what things you can do with this code editor. From useful extensions to shortcuts you probably didn't know about or even making your code editor more light on the eyes, this article is going to showcase some awesome stuff that I found while using it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Extensions
&lt;/h2&gt;

&lt;p&gt;We begin our showcase with some awesome extensions. Now, I'm not going to share all the extensions that I use because some of them are really project focused, but instead I'm going to share the ones that are more generic and make my life as a developer much more easier.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag" rel="noopener noreferrer"&gt;Auto Close Tag&lt;/a&gt; - Automatically add HTML/XML close tag. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory" rel="noopener noreferrer"&gt;Git History (git log)&lt;/a&gt; - View git log, file or line History. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=Zignd.html-css-class-completion" rel="noopener noreferrer"&gt;HTML CSS Class Completion&lt;/a&gt; - Provides CSS class name completion for the HTML class attribute based on the CSS files on your workspace. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=tht13.html-preview-vscode" rel="noopener noreferrer"&gt;HTML Preview&lt;/a&gt; - An extension to preview HTML or Jade files while editing them. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=abusaidm.html-snippets" rel="noopener noreferrer"&gt;HTML Snippets&lt;/a&gt; - Full HTML tags including HTML5 Snippets &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets" rel="noopener noreferrer"&gt;JavaScript (ES6) code snippets&lt;/a&gt; - Code snippets for JavaScript in ES6 syntax. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.js-atom-grammar" rel="noopener noreferrer"&gt;JavaScript Atom Grammar&lt;/a&gt; - The Atom editor's JavaScript text mate grammar. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=donjayamanne.jquerysnippets" rel="noopener noreferrer"&gt;jQuery Code Snippets&lt;/a&gt; - Over 130 jQuery Code Snippets &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.jshint" rel="noopener noreferrer"&gt;jshint&lt;/a&gt; - Integrates JSHint into VS Code. JSHint is a linter for JavaScript. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync" rel="noopener noreferrer"&gt;Settings Sync&lt;/a&gt; - Synchronize Settings, Snippets, launch, keybindings, workspaces and extensions Across Multiple Machines using Github Gist. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=seanmcbreen.Spell" rel="noopener noreferrer"&gt;Spelling and Grammar Checker&lt;/a&gt; - Uses a web service to detect mistakes and suggest fixes - great for Markdown or any text file. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=cssho.vscode-svgviewer" rel="noopener noreferrer"&gt;SVG Viewer&lt;/a&gt; - Pretty self explanatory.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The extensions that I listed above are some of the ones that I use on a daily basis. If I were to choose that ones that I couldn't live without it would be #1, #2, #6, #9, #10.&lt;/p&gt;

&lt;p&gt;For example #10 is a life saver because I'm always switching between my work MB Pro and the MB Air I have at home, so by having a system in place that helps me synchronize my settings is textbook awesome.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shortcuts
&lt;/h2&gt;

&lt;p&gt;Next up are shortcuts. I usually have a few shortcuts that I absolutely can't live without. For example &lt;code&gt;CTRL + D&lt;/code&gt; for multiselect is a must have.&lt;/p&gt;

&lt;p&gt;When VS Code came along with it's integrated Terminal and introduced shortcuts for it, I was hooked. If you're like me and hate to always have to switch between the code editor and the Terminal then you're going to enjoy this. I usually tend to avoid to use the trackpad when I write code that's why I'm going to share some shortcuts that will help you while you code and need a Terminal at the same time.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;CTRL +&lt;/code&gt;` - with this shortcut you can toggle the integrated Terminal. &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;CTRL + SHIFT + &lt;/code&gt;` - this shortcut will add a new Terminal instance, so you can easily work with multiple things at the same time. &lt;/li&gt;
&lt;li&gt;But what if you want to switch between terminal instances? I added a few key bindings so I can easily switch between terminal instances. Of course you can customize them to your liking. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;`&lt;br&gt;
[  &lt;br&gt;
   {  &lt;br&gt;
      "key":"ctrl+shift+=",&lt;br&gt;
      "command":"workbench.action.terminal.focusNext",&lt;br&gt;
      "when":"terminalFocus"&lt;br&gt;
   },&lt;br&gt;
   {  &lt;br&gt;
      "key":"ctrl+shift+-",&lt;br&gt;
      "command":"workbench.action.terminal.focusPrevious",&lt;br&gt;
      "when":"terminalFocus"&lt;br&gt;
   }&lt;br&gt;
]&lt;br&gt;
`&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;CTRL + Q&lt;/code&gt; - In a recent updated the team behind VS Code introduces a new feature. The ability to switch between the different views in the sidebar. Using this shortcut you can easily switch between the Explorer view or the Github view or even the search view. &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;CMD / WIN + B&lt;/code&gt; - I for one like to keep things as light as possible when I'm writing code. With this shortcut you can easily show or hide the sidebar.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The shortcuts I outline above are the ones that I use most often. There are lots of them, that I didn't even mention, and if I did it would overlook the whole purpose of this article. If you know any more, that you think are really useful, let me know and I'll add them to the list.&lt;/p&gt;

&lt;h2&gt;
  
  
  Misc
&lt;/h2&gt;

&lt;p&gt;Since I can't end the article by talking about shortcuts, here are some more cool things you can do in VS Code. Did you know you can hide the activity bar from the View menu? Well, now you do. This feature was added a recent updated and I can say that it is very helpful, even if one has enough real-estate on his/hers monitors.&lt;/p&gt;

&lt;p&gt;What about looks? I, for one, prefer the Spacegray theme. I liked that theme ever since I first found it available while I was using Sublime Text 2. Luckily someone made it available for VS Code as well. Check it out &lt;a href="https://marketplace.visualstudio.com/items?itemName=ionutvmi.spacegray-vscode" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And last, but certainly not least, did you know you can compare files out of the box? I recently needed to compare two different versions of the same file and because they were not on Github, I needed another easy way to achieve this. After a few searches and some extensions later I stumbled upon an article that outlines how you can do that directly inside VS Code. And because I like to give credit where credit is due here is &lt;a href="http://dailydotnettips.com/2015/06/04/how-to-compare-files-in-visual-studio-code/" rel="noopener noreferrer"&gt;the article in question&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, don't get me wrong, I know the things I shared in this article are just a small taste of what VS Code can do, that is why I'm extending an invitation to anyone who is using VS Code to share their experience and their tips and tricks.&lt;/p&gt;

&lt;p&gt;Until next time, code long and prosper!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Image credit: &lt;a href="http://guillaumekurkdjian.com/" rel="noopener noreferrer"&gt;Guillaume Kurkdjian&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post was originally published on &lt;a href="https://stefancosma.xyz/2017/01/08/visual-studio-code-tips-tricks/" rel="noopener noreferrer"&gt;stefancosma.xyz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>development</category>
      <category>tools</category>
      <category>tipstricks</category>
      <category>visualstudiocode</category>
    </item>
    <item>
      <title>Are you bikeshedding? Probably!</title>
      <dc:creator>Stefan Cosma</dc:creator>
      <pubDate>Thu, 03 Mar 2016 10:03:49 +0000</pubDate>
      <link>https://forem.com/stefanbc/are-you-bikeshedding-probably</link>
      <guid>https://forem.com/stefanbc/are-you-bikeshedding-probably</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2016%2F03%2Fchateausable2.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2016%2F03%2Fchateausable2.gif" alt="Are you bikeshedding? Probably!" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You have no idea what I'm talking about, right? That's because not many people use the term &lt;strong&gt;bikeshedding&lt;/strong&gt;. It's not a usual term that people just throw around all the time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bikeshedding is when you argue about some meaningless thing and tend to avoid the more important issue at hand.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example Urban Dictionary tells us this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Technical disputes over minor, marginal issues conducted while more serious ones are being overlooked. The implied image is of people arguing over what color to paint the bicycle shed while the house is not finished.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's take the above image as an example. You see the stick men trying to dump all the water out of the sand castle but avoid the fact that 1. the castle is made of sand and 2. they have a river below their castle that floods said castle.&lt;/p&gt;

&lt;p&gt;In some ways it's like &lt;strong&gt;procrastination&lt;/strong&gt;. You waste your time doing/talking about things that should not be your main focus in the first place.&lt;/p&gt;

&lt;p&gt;This is a growing issue in the tech community. I've worked on projects where the more important issues, like scalability, were overlooked because we couldn't decide how many items should a query contain.&lt;/p&gt;

&lt;p&gt;So, I propose, as Chris Coyier already said in &lt;a href="https://css-tricks.com/what-is-bikeshedding/" rel="noopener noreferrer"&gt;his article&lt;/a&gt;, next time you're in a meeting and you see two people arguing about some meaningless thing, yell &lt;strong&gt;bikeshedding!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Until next time, code long and prosper!&lt;/p&gt;

&lt;p&gt;Stefan&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Image credit: &lt;a href="http://guillaumekurkdjian.com/" rel="noopener noreferrer"&gt;Guillaume Kurkdjian&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post was originally published on &lt;a href="https://stefancosma.xyz/2016/03/03/what-is-bikeshedding/" rel="noopener noreferrer"&gt;stefancosma.xyz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>questions</category>
      <category>bikeshedding</category>
      <category>rant</category>
      <category>work</category>
    </item>
    <item>
      <title>Yak shaving. A short definition!</title>
      <dc:creator>Stefan Cosma</dc:creator>
      <pubDate>Mon, 23 Nov 2015 08:47:02 +0000</pubDate>
      <link>https://forem.com/stefanbc/yak-shaving-a-short-definition</link>
      <guid>https://forem.com/stefanbc/yak-shaving-a-short-definition</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2015%2F11%2FibaDjk7AeIcvxv.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2015%2F11%2FibaDjk7AeIcvxv.gif" alt="Yak shaving. A short definition!" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have you ever started to work on a task and suddenly you realized that said task requires some other little task(s) to be finished beforehand. That's yak shaving for you, the tl;dr version.&lt;/p&gt;

&lt;p&gt;You've probably done this multiple times and you did even realize it.&lt;/p&gt;

&lt;p&gt;Back in 90s a Ph.D. at MIT by the name of &lt;a href="http://projects.csail.mit.edu/gsb/old-archive/gsb-archive/gsb2000-02-11.html" rel="noopener noreferrer"&gt;Carlin J. Vieri&lt;/a&gt; produced this term to describe&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;what you are doing when you're doing some stupid, fiddly little task that bears no obvious relationship to what you're supposed to be working on, but yet a chain of twelve causal relations links what you're doing to the original meta-task.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let me give you an example, that you can relate to.&lt;/p&gt;

&lt;p&gt;You're working on an older project. Let's say that you're ready to deploy, but you suddenly realize that you forgot to set up the Digital Ocean droplet. You start setting that up, but it dawns on you that you need a certain version of PHP. Before you start downloading and setting that up you realize that there are some security issues that need addressing with your droplet.&lt;/p&gt;

&lt;p&gt;And thus you find yourself in an ongoing spiral of never ending little tasks that divert you from the main task. Another comparison would be something like side quests in an RPG type game.&lt;/p&gt;

&lt;p&gt;Why do we do this?&lt;/p&gt;

&lt;p&gt;I think it has to do with the human nature. We're not a species that does things instinctively. We don't know what things can come up at any point in time. At least that's how I see things. Any other thoughts on this?&lt;/p&gt;

&lt;p&gt;Until next time, code long and proper!&lt;/p&gt;

&lt;p&gt;Stefan&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post was originally published on &lt;a href="https://stefancosma.xyz/2015/11/23/yak-shaving-a-short-definition/" rel="noopener noreferrer"&gt;stefancosma.xyz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>task</category>
      <category>development</category>
      <category>definition</category>
      <category>short</category>
    </item>
    <item>
      <title>Switching domains. Is it worth it?</title>
      <dc:creator>Stefan Cosma</dc:creator>
      <pubDate>Fri, 23 Oct 2015 19:01:16 +0000</pubDate>
      <link>https://forem.com/stefanbc/switching-domains-is-it-worth-it</link>
      <guid>https://forem.com/stefanbc/switching-domains-is-it-worth-it</guid>
      <description>&lt;p&gt;This past month, my personal website has been offline. The domain expired and I didn't do anything to prevent this from happening.&lt;/p&gt;

&lt;p&gt;There are multiple reasons why I ignored that aspect.&lt;/p&gt;

&lt;p&gt;The most important one was that, the domain provider doesn't have a business plan that includes customer focus and satisfaction. In other words, they do not make sure the customer is always informed and up to date with everything that happens to their account.&lt;/p&gt;

&lt;p&gt;For eg. I did not receive any prior notice that the domain will expire soon. The only thing I received was a notice that stated the following: your domain has expired, we tried contacting you via the phone number you provided in your account, and you need to pay this X sum of money in order to get it back.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;/start rant&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;They did not try to call me. I have my phone 24/7 on and next to me. I did not receive any call from them.&lt;/p&gt;

&lt;p&gt;Secondly, just by providing your customers with a bill after something expired, without any prior notice, is not a good business tactic.&lt;/p&gt;

&lt;p&gt;I know from experience that, people don't like it when you don't send them updates regarding things they're paying for.&lt;/p&gt;

&lt;p&gt;So, I'm assuming, that their business model is not focused on costumers, at all.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;/end rant&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After that whole fiasco was over, I still had a droplet that was in a dire need of a domain.&lt;/p&gt;

&lt;p&gt;While I was on the lookout for a new domain name, I started turning off all the services that kept my website in a working condition.&lt;/p&gt;

&lt;p&gt;This means that I turned off the droplet, cleared out the nameservers, turned off all the monitoring services that I have active (for some reason I'm using multiple ones, instead of just one) and paused the mailing system.&lt;/p&gt;

&lt;p&gt;So powering down everything was easy. This impacted a lot of things. For starters, from an SEO point of view, everything went haywire. It was like my website went of the grid.&lt;/p&gt;

&lt;p&gt;This was the situation for about a month or so. Then, about a week ago, I came across this domain, and following in the footsteps of Alphabet I registered it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fun part
&lt;/h2&gt;

&lt;p&gt;It took about 3h to get everything back up. Since it was a new domain, and I'm the first owner, the DNS propagation took about ~3h. This was good for multiple reasons and here's why.&lt;/p&gt;

&lt;p&gt;First off, hats off to Ghost for making it easy to change domain names. Just by replacing the domain name in the config file and restarting the service was enough.&lt;/p&gt;

&lt;p&gt;The Cloudflare setup was just a few clicks and ... done!&lt;/p&gt;

&lt;p&gt;Turning on, all the monitoring services, took a bit longer because the domain name was different and I basically had to add every check again.&lt;/p&gt;

&lt;p&gt;Setting up the mail service, since I'm using a third-party one, was again just a few clicks.&lt;/p&gt;

&lt;p&gt;Now that everything was back up and in working order, there was only one issue left. The SEO aspect. I wanted ... scratch that ... I had to update every public account that I owned to feature the new domain name. This meant that I spent about ~2h editing every account and modifying the website. Twitter, G+, Github and so on and so forth. Don't get me wrong, I'm not complaining about this aspect, because it was a chance for me to get up to speed with every account that I own and has a public profile attached to it.&lt;/p&gt;

&lt;p&gt;In terms of website SEO, there was not much I had to do, just adding the necessary things to Analytics and Webmaster tools was enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The question still remains, is it worth it? Does switching domains impact you as a person, as an individual that has created a brand around him / her?&lt;/p&gt;

&lt;p&gt;Initially I would say, yes, but it all depends on your case. It could mean a brand refresh from a marketing stand point but a nightmare for a technical point of view.&lt;/p&gt;

&lt;p&gt;You have to think very hard before making a decision like this and put everything into perspective from a SEO point of view and from a technical stand point. If it's to difficult to change the domain name then stick with it and you should increase your visibility, but that's a whole different discussion.&lt;/p&gt;

&lt;p&gt;What's your opinion on the whole matter? What issues have you faced when switching domain names.&lt;/p&gt;

&lt;p&gt;Until next time, code long and prosper!&lt;/p&gt;

&lt;p&gt;Stefan&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post was originally published on &lt;a href="https://stefancosma.xyz/2015/10/23/switching-domains/" rel="noopener noreferrer"&gt;stefancosma.xyz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>domains</category>
      <category>support</category>
      <category>customers</category>
      <category>rant</category>
    </item>
    <item>
      <title>Working remotely? How to be awesome at it!</title>
      <dc:creator>Stefan Cosma</dc:creator>
      <pubDate>Sun, 26 Jul 2015 19:23:00 +0000</pubDate>
      <link>https://forem.com/stefanbc/working-remotely-how-to-be-awesome-at-it-dk4</link>
      <guid>https://forem.com/stefanbc/working-remotely-how-to-be-awesome-at-it-dk4</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2015%2F07%2Fphoto-1428342319217-5fdaf6d7898e-1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstefancosma.xyz%2Fcontent%2Fimages%2F2015%2F07%2Fphoto-1428342319217-5fdaf6d7898e-1.jpg" alt="Working remotely? How to be awesome at it!" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You may find yourself at some point in your career when you'll be given the opportunity to work for a company that is not based in the same city or region as you are, but instead, said company is located abroad. So, now you're going to work remotely. This means, that you and your team are not going to be in the same physical office space, but each in their own personal "office".&lt;/p&gt;

&lt;p&gt;Now we all know the benefits of working remotely and I'm not going to outline them in this article but instead I'm going to list a few things that can help you achieve greatness when working remotely.&lt;/p&gt;

&lt;p&gt;Whether you're working from home or from a co-working space there are a few things that you can do, to make the whole experience more pleasant and to make sure that you and your team are as productive as possible.&lt;/p&gt;

&lt;h3&gt;
  
  
  Timezones
&lt;/h3&gt;

&lt;p&gt;Make sure you know all the timezones, in which every teammate is working from. Using apps like &lt;a href="http://time.is/" rel="noopener noreferrer"&gt;time.is&lt;/a&gt; you make sure that you won't ping your colleagues while they're having their &lt;strong&gt;sleepy time&lt;/strong&gt;. Of course this doesn't apply if there is an absolute emergency, like failed deploys or huge merge conflicts, that require the assistance of a colleague that is in a different timezone.&lt;/p&gt;

&lt;h3&gt;
  
  
  Schedule
&lt;/h3&gt;

&lt;p&gt;Since we're on the topic of time, you might as well make sure to keep a very transparent schedule. If your colleagues know your daily working schedule, then you won't have any problems. This is really easy to achieve, just set up a public Google calendar with your team and you're good to go. If you keep a very tight and neat schedule then things won't go all haywire, in case of an unforeseen emergency.&lt;/p&gt;

&lt;p&gt;While on the same topic, it's worth mentioning that you should differentiate your work schedule from your non-working schedule.&lt;/p&gt;

&lt;p&gt;When you're not working, make sure to go outside, experience the world. That will get your creative juices flowing. Weather you're having an intensive creative job or not, going outside will reset your mind and you'll be more productive when returning to work.&lt;/p&gt;

&lt;p&gt;Never force yourself to work late hours and always make sure you get enough sleep. As I already mentioned above, you should have a clear schedule that outlines your working hours and your non-working hours. This, of course, only applies if there is no immediate emergency, that requires your attention.&lt;/p&gt;

&lt;p&gt;There are a lot of studies out there that explain the benefits of sleep. Of course we don't know the exact reason why we need sleep, but you should be aware of your circadian rhythm and have a clear idea about your sleep pattern. I won't go into details about this, but I recommend a very &lt;a href="http://www.highexistence.com/alternate-sleep-cycles/" rel="noopener noreferrer"&gt;interesting article&lt;/a&gt; on the whole matter.&lt;/p&gt;

&lt;h3&gt;
  
  
  Office
&lt;/h3&gt;

&lt;p&gt;It doesn't matter if you're working from home or from a co-working space, however it is important to have a proper working space. Now, there are a lot of choices out there to choose from. Here are some of them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A standard desk and ergonomic chair. I, for one, prefer &lt;a href="http://www.ikea.com/us/en/catalog/products/00103102/#/90289172" rel="noopener noreferrer"&gt;this chair&lt;/a&gt;, from Ikea, and any table that has enough leg room.&lt;/li&gt;
&lt;li&gt;A standing desk. This can be any normal desk, where you can place something to keep your computer on a rise and you just ditch the chair.&lt;/li&gt;
&lt;li&gt;A combination between a standard desk / chair combo and a standing desk. To be more specific, I'm talking about &lt;a href="https://www.kickstarter.com/projects/1370698497/a-gravity-the-modern-workstation" rel="noopener noreferrer"&gt;this&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://www.amazon.com/TrekDesk-Treadmill-Desks-TD-01-Desk/dp/B002IYRBI0" rel="noopener noreferrer"&gt;A treadmill desk?&lt;/a&gt; Well, you need to get your daily exercise, right? You do. And what better way to achieve this, then running and working at the same time. Personally I don't recommend this one, because your brain won't be able to focus on that many things, while working, and you'll tend to lose focus fast.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Another important thing to remember when working long hours at a desk is to always stay hydrated. Some recommend that you should drink a certain amount of liquids, in any given working day. Personally I believe that you should drink as much as your body asks for. And when it comes to drinking containers I absolutely love &lt;a href="http://www.kleankanteen.com/" rel="noopener noreferrer"&gt;this canteen&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Staying connected
&lt;/h3&gt;

&lt;p&gt;We were bound to reach this subject at some point. Now I'm sure everyone has their preferred social networks to stay connected with friends and family, but how does one stay connected with their co-workers?&lt;/p&gt;

&lt;p&gt;There are a lot of good apps out there, that offer a lot of features for staying connected with your team. The most popular are Slack and Hipchat. But one has a slight advantage over the other as outlined in this Medium &lt;a href="https://medium.com/@awilkinson/slack-s-2-8-billion-dollar-secret-sauce-5c5ec7117908" rel="noopener noreferrer"&gt;article&lt;/a&gt;, that I recommend you read.&lt;/p&gt;

&lt;p&gt;It's always good to have a team meeting with your team on a weekly basis. That way you can verbally outline your current tasks and what you're planning on working on. Having short 1 hour sessions with the entire team will give you a clear idea about the things that are getting done. You can use apps like &lt;a href="http://zoom.us" rel="noopener noreferrer"&gt;Zoom&lt;/a&gt; or &lt;a href="https://www.uberconference.com" rel="noopener noreferrer"&gt;UberConferance&lt;/a&gt; to host team meetings.&lt;/p&gt;

&lt;p&gt;I don't recommend using Skype or Google Hangouts for team meetings because the quality for those is very poor, when it comes to video / audio and the drop-off rate is very high (at least from what I experienced).&lt;/p&gt;

&lt;p&gt;Another important aspect when working remotely is to have a access to a good bug / task tracker app. Now, I know each company has it's own system of doing things. Whether you're using an internal build app or something public, that anyone can use, it's important to keep it up to date with tasks and bugs. Make sure your team knows what you're working on and also you'll need an easy way to report bugs and discuss upon them.&lt;/p&gt;

&lt;p&gt;I don't have any favorites, but I can recommend a few good apps, that I've crossed paths with. You could try &lt;a href="https://asana.com" rel="noopener noreferrer"&gt;Asana&lt;/a&gt;, &lt;a href="http://www.pivotaltracker.com" rel="noopener noreferrer"&gt;Pivotal Tracker&lt;/a&gt;, &lt;a href="https://trello.com" rel="noopener noreferrer"&gt;Trello&lt;/a&gt;, &lt;a href="https://www.atlassian.com/software/jira" rel="noopener noreferrer"&gt;Jira&lt;/a&gt; and let's not forget &lt;a href="https://www.mantisbt.org" rel="noopener noreferrer"&gt;Mantis&lt;/a&gt;. All of these are multipurpose, so you can use them for either tracking bugs or tracking tasks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Recommendations
&lt;/h3&gt;

&lt;p&gt;Before I wrap this up, I have a few extra recommendations.&lt;/p&gt;

&lt;p&gt;Make sure that at some point, while working for the company you're working remotely for, you arrange a meet-up with your team face to face or IRL. There's nothing like meeting people in person. Sure, you see them via video but it's something different when you actually meet a person. You observe their body language and thus you'll be able to understand them better, when working on something.&lt;/p&gt;

&lt;p&gt;And last but not least, try to use social media to stay connected. you'll find that socialising with your team outside the work realm is going to be beneficial for your work relationship.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In order to be awesome at working remotely, you need to make sure that you have a well established schedule and you're office space is properly organised. I'm not saying you should follow my recommendations, it's your life, you can what ever you want, these are just things I came across while working remotely, that worked for me.&lt;/p&gt;

&lt;p&gt;As an added bonus I highly recommend &lt;a href="http://www.lifehack.org/articles/work/9-reasons-why-remote-working-awesome-and-how-make-the-most.html" rel="noopener noreferrer"&gt;this article&lt;/a&gt;, on Lifehack, about making the most of working remotely.&lt;/p&gt;

&lt;p&gt;What other things did I miss? Let me know in the comments bellow.&lt;/p&gt;

&lt;p&gt;Until next time, code long and prosper!&lt;/p&gt;

&lt;p&gt;Stefan&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post was originally published on &lt;a href="https://stefancosma.xyz/2015/07/26/working-remotely-how-to-be-awesome-at-it/" rel="noopener noreferrer"&gt;stefancosma.xyz&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>useful</category>
      <category>awesome</category>
      <category>tools</category>
      <category>apps</category>
    </item>
  </channel>
</rss>
