teleren/devto huggingface dataset:
Kat's Mastodon Quickstart for Twitter Users
Tags: twitter, mastodon, tutorial
Published: 2021-03-17 00:51:34

So you like Twitter, but you're curious about Mastodon? You've come to the right place. I'll make this real quick for you, and you can explore further from there, if you want to get more out of it. My setup is pretty straightforward and lets me post to both Twitter and Mastodon as needed, and maintain both communities easily.

## Step 1: Get an Account

A defining feature of Mastodon is that you can make an account on many different servers, but those servers can talk to each other (aka "Federation"). Picking a server and signing up for it is the first step, but it can be daunting, with so many choices, so let's simplify:

* You like Open Source: https://fosstodon.org
* You're queer and you like tech: https://tech.lgbt
* You want to see/post art: https://mastodon.art or https://artalley.social
* You want the most reliable/biggest instance: https://mastodon.online/ (please avoid this one. You'll miss out on some aspects of Mastodon culture by just defaulting here).
* You like Kat and/or want a chill place and a cute domain name: https://toot.cat
* You want to take more time to make a more informed choice: https://joinmastodon.org

P.S. You can always move to a new account. Mastodon has a migration feature that leaves a "tombstone" behind and helps you move over to your new account. Don't sweat this choice too much!

## Step 2: Link Mastodon ↔ Twitter

1. Go [here](https://crossposter.masto.donte.com.br/) and authenticate with both accounts. It's safe.
1. Go [here](https://crossposter.masto.donte.com.br/user) and enable crossposting both ways (if that's what you want).
1. BONUS: Copy my advanced settings: 
    * [Mastodon -> Twitter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h6lvyvrp9hiwfrkct87r.png)
    * [Twitter -> Mastodon](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/akhu9h4rezgbgy3pxxl2.png)

## Step 3: Get a Mobile Client

* Android: There's an [Official App](https://play.google.com/store/apps/details?id=org.joinmastodon.android&gl=US), or [Tusky](https://play.google.com/store/apps/details?id=com.keylesspalace.tusky)
* iOS: There's an [Official App](https://apps.apple.com/us/app/mastodon-for-iphone-and-ipad/id1571998974), or [Toot!](https://apps.apple.com/hu/app/toot/id1229021451)
* Windows/macOS/Linux: [Sengi](https://nicolasconstant.github.io/sengi/)
* Or, just use the web interface, which is pretty good! It also works as a Progressive Web App, so you can set it up as a "standalone" app!

# Step 4: Make Friends!

* Check out your instance's local and federated timelines for interesting stuff.
* Link this article on Twitter and get your friends to join.
* Follow me on Mastodon: [zkat@toot.cat](https://toot.cat/@zkat)
* Send me a message by @-ing `@zkat@toot.cat hello world`!

# Step 5: Sh*tpost

Do the thing! Welcome to the Fediverse 💞

If you want a more in-depth guide, check out https://github.com/joyeusenoelle/GuideToMastodon
How to find the storage location of Docker images and containers on a mac
Tags: devops, docker, macos, unix
Published: 2021-03-17 00:20:49

Finding the location of docker images is a chore on a mac. Usually on most systems, you can see where the images and containers are located by running the command `docker info` but no, that does not work on a mac. You see that command will tell you that the root directory is located at `/var/lib/docker` , which on a mac is a non-existent directory.

>There are two primary ways to get to this directory. Try option **1** first, if it does not work try option **2**

# Here is a little background information on the docker directory

On a mac our docker files are located inside of a virtual machine which is located in our user library directory: `~/Library/Containers/com.docker.docker/`

This directory is easy to get to from the **terminal**, but if you try to get there via the **finder** you might notice that **com.docker.docker** does not appear visually under that directory name. When you navigate to `~/Library/Containers` you will see the folder name **Docker** instead. Take note, that is the **com.docker.docker** directory

![docker directory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yhejyl52iwr07qxxjlxl.png)


_Now to get to the root directory `/var/lib/docker` we must access the docker virtual machine being used on our mac._


----
# Option 1
Use the terminal application **screen**.

```bash
screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
```
You **should** see a screen, where you can enter the command
```
cd /var/lib/docker
```
----
# Option 2
Now if you are unlucky and you get a **permission denied** error, you will need to try to access the docker virtual machine through a docker image:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zz7hlz5hpltlavsh6juc.png)

To get around this error, we will install a **debian** docker image, run it, then enter the container with the [nsenter](https://www.tutorialspoint.com/docker/docker_containers_and_shells.htm) tool

```
docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh
```
This will open the **debian** image and allow us to browse around the docker files via the **sh** shell

Now that the shell is available. let's type the command

```
cd /var/lib/docker
```

If the default storage driver **overlay2** was used, then your Docker images are stored in the directory `/var/lib/docker/overlay2`

![docker files](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jid4hy8y4myujz0sp8ej.png)

---

To get a detailed explanation of the **docker run** flags, type  `docker run --help` command in the terminal.

---

## Sources

Learn more about [nsenter](https://www.redhat.com/sysadmin/container-namespaces-nsenter) linux tool on the redhat linux website.


[Getting path and accessing persistent volumes in Docker for Mac](https://timonweb.com/docker/getting-path-and-accessing-persistent-volumes-in-docker-for-mac/) by Tim Kamanin 

[Github : docker can't access volume with screen
docker](https://github.com/docker/for-mac/issues/4822)
4 tips to jump the PR review queue
Tags: codereview, productivity, practices, github
Published: 2021-03-18 11:46:35

---
title: 4 tips to jump the PR review queue
published: true
date: 2021-03-17 00:00:00 UTC
tags: codereview, productivity, practices, github
canonical_url: https://jhall.io/archive/2021/03/17/4-tips-to-jump-the-pr-review-queue/
---

Are you tired of waiting for your colleagues to review your pull requests? Here are some quick tips to help your PRs filter to the top of the proverbial review queue.

1. **Short and sweet** — Nobody likes reviewing long PRs. It might not be fair, but ten 10-line pull requests will generally get reviewed faster than a single 100-line pull request.
2. **Limit scope** — One of the surest ways to confuse someone reading your change set is to mix concerns. Keep each PR focused on a single thing. One feature addition, one bug fix, or one refactor per PR!
3. **A good title** — Give your PR a meaningful _and accurate_ title. “Bugfix” doesn’t cut it. If someone has to divine the reason for your PR from the code, it’s a bad PR, and cognitive load (and thus wait times) go up!
4. **A good description** — Link to any relevant issues, stories, or other related changes in the description. If there’s anything at all unclear about your changes, explain it. Don’t make your reviewer guess, or leave a comment asking for basic information.
Interested in learning how to make this layout with React and Tailwind CSS?
Tags: tailwindcss, react, css
Published: 2021-03-17 05:47:00

---
title: Interested in learning how to make this layout with React and Tailwind CSS?
published: true
date: 17/03/2021
tags: Tailwind, React, CSS
canonical_url: https://peterwitham.com/react-tailwindcss-layout-interest
---

[![React & Tailwind CSS layout screenshot](https://peterwitham.us/static/5713deaa6cbc3be0af9fdf6e928d2033/121b3/reacttailwindcssfinalayout.jpg "React & Tailwind CSS layout screenshot")](/static/5713deaa6cbc3be0af9fdf6e928d2033/121b3/reacttailwindcssfinalayout.jpg)

There is no doubting that React has helped many create applications quickly and efficiently. Along with that, I have come to appreciate Tailwind CSS for helping me get the layouts I need without having to make a whole bunch of CSS code.

The more I use these tools, the more I want to share the joy with others and get you started on the path to easier Web app development.

I wonder if there is enough interest in a series of videos to show how I created this layout that scales with the browser.

Since it takes a while to record and edit them, I decided to reach out and ask if there is any interest before working on the project.

If this sounds like something you are interested in, please let me know to gauge your interest by filling in the simple form. I will only use the data to reach out should the project have enough interest. Otherwise, I will delete it.

[The form is here on my site, thanks.](https://peterwitham.com/react-tailwindcss-layout-interest)
Sprint Timeline
Tags: agile, programming, productivity
Published: 2021-04-13 12:09:11

---
title: Sprint Timeline
published: true
date: 2021-03-17 00:00:00 UTC
tags: agile, programming, productivity
canonical_url: https://www.goingserverless.com/blog/two-week-sprint-timeline
---

If you need to run an agile sprint timeline this document might help.

<!-- more -->
## Timeline

The timeline for a 2 week sprint

| Day | Day of Week | Description |
| --- | --- | --- |
| -5 | Wednesday | Sprint Planning Meeting |
| -4 | Thursday | |
| -3 | Friday | |
| -2 | Saturday | |
| -1 | Sunday | |
| 0 | Monday | Sprint Grooming / Sprint Start |
| 1 | Tuesday | Standup |
| 2 | Wednesday | Standup |
| 3 | Thursday | Standup |
| 4 | Friday | Standup |
| 5 | Saturday | |
| 6 | Sunday | |
| 7 | Monday | Standup |
| 8 | Tuesday | Standup |
| 9 | Wednesday | Standup |
| 10 | Thursday | Standup |
| 11 | Friday | Standup |
| 12 | Monday | Final Day / Standup / Retro |

## Points

The number of points a developer should target during the sprint depends on the number of days they are working.

| Days Worked | Min Points | Max Points |
| --- | --- | --- |
| 1 | 1 | 2 |
| 2 | 3 | 4 |
| 3 | 5 | 6 |
| 4 | 7 | 8 |
| 5 | 9 | 10 |
| 6 | 11 | 12 |
| 7 | 13 | 14 |
| 8 | 14 | 16 |
| 9 | 16 | 18 |
| 10 | 18 | 20 |

When allocating points to a task use the following table. If a story takes longer than 5 days it should be broken down into multiple stories.

| Points | Days |
| --- | --- |
| 1 | ½ |
| 2 | 1 |
| 3 | 1-2 |
| 5 | 2-3 |
| 8 | 5 |
Node.js Docker Service Tips
Tags: unraid, windows, docker, papertrail
Published: 2021-03-16 21:46:23

[Last time](https://dev.to/felizk/remote-deploy-with-docker-compose-to-unraid-1dai) I deployed some docker containers remotely to Unraid. Now let me share a tip or two for the node.js part of those containers.

---

# Graceful exit
Node.js applications do not automatically know how to gracefully shut down when a container is stopped. To do this you'll have to handle signals.

I followed this nice guide: [Building Graceful Node Applications in Docker](https://medium.com/@becintec/building-graceful-node-applications-in-docker-4d2cd4d5d392) and they got the signal handling from here [Trapping signals in Docker containers](https://medium.com/@gchudnov/trapping-signals-in-docker-containers-7a57fdda7d86).

The crux of the code is to add a listener to `process`:

```
function shutdown() {
  // close your server here
  process.exit();
}

process.on('SIGTERM', shutdown); 
process.on('SIGINT', shutdown); 
```
[Node.JS Signal Events Documentation](https://nodejs.org/api/process.html#process_signal_events) doesn't call `process.exit()` but it turns out Docker does funny things due to the process having ID 1, this is the most up to date post I've found about that issue: [Top 4 Tactics To Keep Node.js Rockin’ in Docker](https://www.docker.com/blog/keep-nodejs-rockin-in-docker/) see "Start Node Directly in Dockerfiles".

---

# Container content not updating
Another issue I ran into with my node.js container was that when I made changes to my `index.js` and ran the command to deploy my containers to Unraid, the Unraid nodeserver container would not have my changes.

I searched for a solution and `-no-cache` and `--force-recreate` were both suggested, but these methods did not fix the problem.

The only thing I found that actually fixed the issue was to remove the container and images from Unraid before building new ones and deploying those.

```
docker-compose --context unraid -f docker-compose.yml -f docker-compose.prod.yml down --rmi local
docker-compose --context unraid -f docker-compose.yml -f docker-compose.prod.yml up --build -d
```
Now, arguably an even better way would be to not put the index.js into the container, but instead mount a path to run index.js from. Then just restart the nodeserver container when I made changes. Which is probably what I would do in the future for iteration.
How to push the commits to the branch if the commits are rejected after the git rebase process?
Tags: git
Published: 2021-03-17 00:00:00

---
  title: How to push the commits to the branch if the commits are rejected after the git rebase process?
  published: true
  tags: Git
  date: Wed Mar 17 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/push-commits-to-branch-if-rejected-after-rebase-git
  cover_image: https://melvingeorge.me/_next/static/images/main-e2ebd25ff1b669217dba022754d38db1.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/push-commits-to-branch-if-rejected-after-rebase-git)
  
To push the changes to the branch after a rebase, you need to force push your commits using the `-f` or `--force` flag in the `git push` command on Git.

It can be done like this,

```bash
# Push commits to branch after git rebase

git push origin -f FEATURE_BRANCH_NAME
```

- This is because something has changed in the remote branch and the commit history is different for both the remote and your local branch.

- If you try to push the local changes then the git will reject it by saying with a message like `the tip of your current branch is behind its remote counterpart`. Doing a force push to the local brach solves the problem.

- Don't be afraid of it. This is a good approach if you are the only one working on the same branch. 👍🏽

I hope this answer helped you! Cheers 😃

### Feel free to share if you found this useful 😃.

---
GitHub Actions HTTP security with Mozilla Observatory
Tags: nextjs, github, devops, security
Published: 2021-03-16 23:54:18

Since I discovered the Mozilla observatory tool I have been looking at bringing it into my CI/CD process.

I decided I would write a GitHub action that uses the Mozilla observatory, to check some web security basics on my pull requests.

The results, a GitHub action that can leave comments indicating how secure your HTTP configuration is.

![Example GitHub action output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g5x3zg9c3emrtadhiab9.jpg)

Armed with these reports you can make improvements, and iterate security best practices.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjvkuzc4j90chat5eq4d.jpg)

There is a detailed example on my blog [here](https://simonireilly.com/posts/github-observatory-action)

The action is available on GitHub actions marketplace [here](https://github.com/marketplace/actions/observatory-github-action)
Inclusive Components by Heydon Pickering: a chapter by chapter review
Tags: a11y, discuss
Published: 2021-03-16 23:06:13

This post is the first in a series of posts in which I discuss and reflect upon what I've learnt from reading Inclusive Components. The book, written by Heydon Pickering, explores how web developers can create accessible components with semantic HTML, and how we can avoid using JavaScript unnecessarily by leveraging CSS to add both functionality and styling to our web pages. 

Each chapter focusses on a different component. Amongst others, Pickering talks us through toggles buttons and menu buttons, collapsible section and check boxes - components we interact with on the web as users everyday. But as Pickering points out in his introduction, such components are often badly designed and executed, and therefore the web interfaces they form part of become all the more difficult to use.

Accessibility isn't going anywhere, and we're already (rightfully) at a point where accessible websites a necessity rather than a nice to have. It's very much a case of when, not if, features need to be reworked and updated to meet the increasingly rigorous guidelines around accessible design. 

Through this series of posts, I hope to create a conversation between Pickering's views on creating inclusive components and my own experiences of developing accessible (and sometimes less than accessible) interfaces. I'll begin, unsurprisingly, with chapter one - toggle buttons.
How to Add a Browser Tab Icon to Your Websites!
Tags: codenewbie, html, css, icons
Published: 2021-03-16 22:54:02

Adding an icon to the browser tab of a website you created is like the cherry on top! The *best* part about it, is how incredibly simple it is to add one.

![browser displaying browser tab icons](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nlfmvb9rg7y6gkehb456.png)

**1.** Find an image which you'd like to use as your favicon.

**2.** Save the image inside the folder which contains all your website's files. (index.html, styles.css, scripts, images, etc.)

**3.** Similar to how you link your external CSS stylesheet, in the `<head>` section of your HTML document, you do the exact same to link the icon, however, for the relationship you add 'icon' and for the href you'd add the image's location, for example: 
 ```<link rel="icon" href="images/example.png">```

*Tada! It's really that easy.*

I know it's something so subtle but I still get excited every time I get to put an icon on the browser tab of a website I created.

*My favorite website to find icons is:*
https://freeicons.io/


###Hope this helps, Happy coding!
App First, Platform Later
Published: 2021-02-13 20:27:02

---
title: App First, Platform Later
published: true
date: 2021-02-11 02:37:42 UTC
tags: 
canonical_url: https://peterwitham.com/app-first-platform-later
---

As Apple platforms unify the user experience and underlying technologies, we need to change our approach to making apps.

Instead of designing for, say, iOS and then expand to macOS later. We need to think about universal design and experience in our applications and then adapt it as required for each platform while retaining as much of the core design and idea as possible on all platforms.

Not only does this give a more natural feel to the user when they move from platform to platform, but it also enables us to think about feature parity. If we have the features on every platform, we can then give more thought to the UI's implementation if needed for a particular part as appropriate.

We are starting to see applications running on various platforms in ways that we had not imagined until now. iOS applications are running on Macs with the new Apple silicon, for example. We have to adapt our thinking and planning to allow for the possibility that our applications operate in ways we had not anticipated. Spending more time making sure our interfaces work nicely beyond our intended device or audience will enhance the experience.

There is another aspect that will become more important as we move forward.

Data syncing, users will expect that if an application exists on more than one platform or device, they should see their data or files on all those devices. For example, writing applications should make documents available for the user whenever they want to continue working.

When I evaluate an application used to create content of any kind, one of the primary things I check is to see if I can work on more than one device. I want to work on my iPhone, iPad, Mac, and even Windows depending on the need in an ideal situation.

At the very least, I expect to use my Mac and iPad as primary work drivers when I'm blogging or creating podcasts, for example.

Take these thoughts into account when you create a new project or consider adding to an existing one. Your users will thank you for it.
Nasty exceptions in Timer scope
Tags: dotnet, csharp
Published: 2021-03-16 22:37:00

## TL; DR

Unhandled exceptions occurring in Timer scope in a .Net Core application will crash the application without any logs or any graceful shutdown. Make sure to catch any exceptions in Timer scope and handle them without rethrowing.

## Timer scope

With Timer scope I refer to any method that is set to execute when a Timer fires. Typically the code would look something like this:
```csharp
var timer = new System.Threading.Timer(MethodInTimerScope);
...
private void MethodInTimerScope(object state)
{
    // Perform Timer based task
}
```

## Exceptions in Timer scope

When an unhandled exception occurs within request scope (anything initiated from an incoming HTTP request through a Controller), it will be caught by a default exception handler. The exception will be logged and the request will receive a 500 response.
Similarly, when an exception occurs during application startup, shutdown, or inside a Background task (such as a [BackgroundService](https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.hosting.backgroundservice)), it is nicely logged and handled appropriately.

However, when an unhandled exception occurs within Timer scope, it seems this scope is out of reach for the regular catch-alls of exceptions. It causes the whole application to crash immediately, without leaving any clues behind in the logs.

## Avoiding hard crashes from Timer scope exceptions

The key to avoiding this situation is to catch any exceptions within the Timer scope to log and handle them. If the exceptions are so severe that the application should shut down, a graceful shutdown operation can be initiated using the [IHostApplicationLifetime.StopApplication()](https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.hosting.ihostapplicationlifetime.stopapplication?view=dotnet-plat-ext-5.0#Microsoft_Extensions_Hosting_IHostApplicationLifetime_StopApplication) method.

### Disclaimer

This applies for .Net Core 3.1 and above. Has been tested on Windows with IIS hosting, and on OS X from Visual Studio.