<?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: Meike</title>
    <description>The latest articles on Forem by Meike (@schlenges).</description>
    <link>https://forem.com/schlenges</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%2F114796%2Fc9d6e154-7d99-482e-a2da-1415d38f12b2.jpeg</url>
      <title>Forem: Meike</title>
      <link>https://forem.com/schlenges</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/schlenges"/>
    <language>en</language>
    <item>
      <title>How to Manoeuvre Twitter as an Ordinary Mortal and Keep Your Sanity</title>
      <dc:creator>Meike</dc:creator>
      <pubDate>Sun, 19 Jul 2020 21:54:09 +0000</pubDate>
      <link>https://forem.com/schlenges/how-to-manoeuvre-social-media-as-an-ordinary-mortal-and-keep-your-sanity-451n</link>
      <guid>https://forem.com/schlenges/how-to-manoeuvre-social-media-as-an-ordinary-mortal-and-keep-your-sanity-451n</guid>
      <description>&lt;p&gt;Do you often find yourself shaking your head in disbelief, questioning all of humanity and feeling completely out of place while browsing through Twitter? If the answer is yes, here are some tips that helped me personally to start enjoying the medium again:&lt;/p&gt;

&lt;h2&gt;
  
  
  1) Change Your Settings
&lt;/h2&gt;

&lt;p&gt;THE most effective thing to do is to ALWAYS make sure you have your feed set to "show latest tweets first". This way you have much more control over what content makes its way into your feed. Only tweets and retweets of people you actually follow will appear, which drastically minimizes the likelihood of content from accounts outside of your choosing creeping its way in. If you choose Twitter’s other option, a huge chunk of what pops up on your screen will be whatever the people you follow are liking left and right. If you are truly interested and curious to see what a particular person is liking you can still check out their profile and have a look at their likes without being spammed by every single interaction each person you follow is having. Make sure to check up on that setting every now and then as Twitter will periodically switch it back.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/UQs5mIJEvHVKfZKYXu/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/UQs5mIJEvHVKfZKYXu/giphy.gif" alt="Gif showing where to access feed settings" width="480" height="250"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;h2&gt;
  
  
  2) Limit Who You're Following
&lt;/h2&gt;

&lt;p&gt;Be selective about who you follow. No, you are not a bad person for not following someone back who started following you. You have no obligation to that account and/or person whatsoever. There definitely is a thing as netiquette, but the whole “I follow you, you follow me” culture is not part of it. If someone starts following you, one would assume they do so because they are interested in what you are tweeting about. If you happen to be interested in the content they share as well, perfect! But if you’re not, then that is just as good. Be genuine and don’t follow accounts or people you are not actually interested in. They will only clutter up your Twitterverse and take away space from what you actually want to see.&lt;/p&gt;

&lt;h2&gt;
  
  
  3) Make Use of the Block Button
&lt;/h2&gt;

&lt;p&gt;With that said, also have an eye on who is following you. If you feel uncomfortable with certain people or you suspect some accounts might attract bots or scammers, get rid of them. I’m not sure a lot of users are aware of that, but it is fairly easy to get rid of unwanted followers. If you really want them out of your sight, you can just block them and leave it at that. You don’t have to be as strict though - if you block someone and then go in and hit the unblock button again, they will be gone from your follower list all the same, even without being banned completely. (By the way, in case you have second guesses or some form of guilty conscience about using this method: I promise you, more often than not, people won’t even notice they aren’t following you anymore. And if they do and truly are interested in your content, they will follow you again.)&lt;/p&gt;

&lt;h2&gt;
  
  
  4) Make Use of the Lists Feature
&lt;/h2&gt;

&lt;p&gt;Another thing I believe a lot of people underestimate is the usefulness of Twitter lists. It’s the perfect way to keep accounts and topics organized and easily opt in and out of different content. If you are a coder for example, instead of starting to follow hundreds of different coding accounts and completely flood your feed on a daily basis, simply create a list for them. That way you still have everything related to that topic conveniently grouped together in one place, but you are left with the possibility of consciously deciding when to check in and up on all those tweets. You won’t get bombarded with all that noise first thing every time you enter Twitter but only when you feel up for it. Keep your actual feed small so that you won’t miss out on content that is truly meaningful to you and people you are actually wanting to connect and interact with on a regular basis.  &lt;/p&gt;



&lt;p&gt;Every single one of us is creating a bubble on this platform, that is just an unavoidable fact. But it is up to you if you consciously shape what that bubble looks like or if you just let it grow randomly. If you truly wish to do so, you can make spaces like Twitter into your own little happy place, find genuine connection, inspiration and fruitful exchanges. There is a way of using social media that will leave you connected with the world without having to sacrifice your mental health, happiness or peace of mind. Don’t let it overwhelm you or take you over. As long as you use it in a conscious way, it can be such a great place to learn and connect. As with everything, just be mindful about it and put your happiness first.&lt;/p&gt;

</description>
      <category>twitter</category>
      <category>mentalhealth</category>
      <category>socialmedia</category>
    </item>
    <item>
      <title>Promises, Promises...</title>
      <dc:creator>Meike</dc:creator>
      <pubDate>Tue, 01 Oct 2019 17:48:36 +0000</pubDate>
      <link>https://forem.com/schlenges/promises-promises-37ff</link>
      <guid>https://forem.com/schlenges/promises-promises-37ff</guid>
      <description>&lt;p&gt;Ah! Promises! Who doesn't know the joys and disappointments that come with these future oriented constructs - no matter if we are talking about JavaScript promises or their human verbal counterparts! In the end, that's the whole point, right? They don't just arbitrarily share a name, but also behave pretty much the same. Here's an example:&lt;/p&gt;

&lt;p&gt;Suppose as a child we wanted nothing more badly than a gaming console. Our father promises to fulfill us our wish and get us a console for our birthday. Once stated, the outcome of this promise is still pending though - if our father is a man of his word and we will indeed hold the object of desire in our hands once our birthday comes around, the promise has been fulfilled. Should he (maybe under the never to be underestimated influence of the mother) change his mind however, the promise will be rejected.&lt;br&gt;
In JavaScript, promises are also always in one of these three states: either pending, fulfilled, or rejected. If we were to translate the example from above into code, it could look something like this:&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;isDadInfluencedByMum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;willIGetTheConsole&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reject&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="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isDadInfluencedByMum&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;gameConsole&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;brand&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;xbox&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;black&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gameConsole&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// fulfilled&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;reason&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Oh no... Mum had a word with dad!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// rejected&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;Should the father stay uninfluenced by the worries of the mother regarding the acquisition of a gaming console, the promise will be kept and the resolve() method of the Promise object is called. The method sets the state of the Promise as fulfilled with the value of the argument it is given - in this case the gameConsole object. However, should the mother happen to have a word with the father before our birthday, it could happen that her influence will convince him to reject the idea of a gaming console after all and therefore the promise. In that case the reject() method with the reason for the rejection is called.&lt;/p&gt;

&lt;p&gt;Now, once our birthday rolls around and we finally get to open the presents, one out of two scenarios could happen: either the promise of the father has been fulfilled and we find a new black Xbox in our possession, or we have to realise once again that mothers always have the final say...&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;openPresent&lt;/span&gt; &lt;span class="o"&gt;=&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;willIGetTheConsole&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;fulfilled&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fulfilled&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// output: {brand: 'xbox', color: 'black}&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;error&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// output: 'Oh no... Mum had a word with dad!'&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;openPresent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The purpose of promises in JavaScript is mainly to provide a more elegant way of handling asynchronous code without having to fall into the dreadful callback hell. For that reason JavaScript promises can be chained, so that we are able to define promises that depend upon another.&lt;/p&gt;

&lt;p&gt;Getting back to our example:&lt;br&gt;
After the father has promised us to fulfill our wish, we rush to our friends in order to report the good news. Obviously the excitement and curiosity of the friends is just as big as our own, so we promise them that everyone gets to play with the console at the birthday party. In order to be able to keep this promise though, our father, of course, has to fulfill his one first.&lt;br&gt;
Let's put our promise to the friends into code:&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;letEveryonePlay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gameConsole&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resolve&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;invitation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`Hey, let's all play together with my new &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;gameConsole&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;brand&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;!`&lt;/span&gt;
    &lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;invitation&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;Now we're going to chain the two promises together. We can do this by using the then() method. First we have to wait and see if the father has kept his promise and we actually got the gaming console, only then can we fulfill our promise to the friends:&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;openPresent&lt;/span&gt; &lt;span class="o"&gt;=&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;willIGetTheConsole&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;letEveryonePlay&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;fulfilled&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fulfilled&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// output: "Hey, let's all play together with my new xbox!"&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;error&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// output: 'Oh no... Mum had a word with dad!'&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;openPresent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once we finally get to rip off the wrapping paper and discover the gaming console we are able to fulfill our promise and invite all of our friends to play with it.&lt;br&gt;
The fulfilled promise of &lt;em&gt;willIGetTheConsole&lt;/em&gt; returns the &lt;em&gt;gameConsole&lt;/em&gt; object, which we then use in the &lt;em&gt;letEveryonePlay&lt;/em&gt; promise to get the brand of the console in order to return a proper formulated invitation message, which we can then print once the promise of &lt;em&gt;letEveryonePlay&lt;/em&gt; has been fulfilled.&lt;/p&gt;

&lt;p&gt;Should the present contain something else though, the reason why we have to disappoint our friends is likely going to be the same as before - the voice of reason has spoken and the father has caved in.&lt;/p&gt;

&lt;p&gt;I hope this little example was able to help one or the other in understanding how to make use of JavaScript's promises. Even if you are not necessarily confronted with the problem of having to wait for an "ok" from your parents to get yourself a gaming console anymore, they are just as suited e.g. to make sure a full set of data is returned before further processing it, or keeping code for unzipping files in check until they have been fully downloaded. Whatever the use case, thanks to their "chainability", promises are definitely a much more readable and elegant solution to a bunch of deeply nested callback functions and once you get your head around how they work, you will not want to miss them. &lt;/p&gt;

&lt;p&gt;Promise!&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
  </channel>
</rss>
