teleren/devto huggingface dataset:
Generate Mermaid Diagrams for Your Database
Tags: mermaid, database, erdiagram
Published: 2021-02-12 23:43:48

---
title: Generate Mermaid Diagrams for Your Database
published: true
description: How to Generate Mermaid Diagrams for Your Database
tags: mermaid, database, erdiagram
//cover_image: https://direct_url_to_image.jpg
---

[mermaid](https://mermaid-js.github.io/mermaid/#/) describes itself as a "Markdownish syntax" for generating entity-relationship diagrams. You can learn syntax in minutes, but it may take you longer to represent your database. SchemaCrawler generates mermaid syntax from your existing database. Then you can see what it looks like in the [mermaid live editor](https://mermaid-js.github.io/mermaid-live-editor/), as well as make modifications.

Try it out. Make sure that you have [Docker](https://docs.docker.com/desktop/) installed on your system, or download [SchemaCrawler](https://www.schemacrawler.com/). Download a sample SQLite database called ["chinook-database-2.0.1.sqlite"](https://github.com/schemacrawler/chinook-database/releases/download/v16.11.7/chinook-database-2.0.1.sqlite) into your current directory.

Then run a command like:

```sh
docker run \
--mount type=bind,source="$(pwd)",target=/home/schcrwlr/share \
--rm -it \
schemacrawler/schemacrawler \
/opt/schemacrawler/bin/schemacrawler.sh \
--server=sqlite \
--database=share/chinook-database-2.0.1.sqlite \
--info-level=standard \
--command script \
--script-language python \
--script mermaid.py
```

(If you are using PowerShell on Windows, replace the trailing backslash on each line with a back-tick "`".)

Copy the output into the  [mermaid live editor](https://mermaid-js.github.io/mermaid-live-editor/) and see what it looks like. Once you have got this working, you can connect to any database - whether Oracle, MySQL, PostgreSQL, Microsoft SQL Server, IBM DB2 or any other database that SchemaCrawler supports.

If you want to customize the script, grab the source from  of ["mermaid.py" from SchemaCrawler's GitHub repository](https://github.com/schemacrawler/SchemaCrawler/blob/master/schemacrawler-scripting/src/test/resources/mermaid.py), and follow instructions on the [scripting gist](https://gist.github.com/sualeh/4aebf7098f5907467df20d00f03962cd).

To learn about how to use SchemaCrawler, download the [SchemaCrawler distribution zip file](https://github.com/schemacrawler/SchemaCrawler/releases/) and go through the examples.
Writing is hard
Tags: writing
Published: 2021-02-13 04:45:21

Writing is hard, especially when you're first start, but its rewards is beyond what you can image. Just pick up one bloody problem you want to write about, engage with the material until you find something that grips you that you desire to investigate it.

Writing is a process of investigating, sorting, summarizing, formulating, integrating in your own personality at the highest and most abstract level of organization.~~(borrowed from JORDAN PETERSON)~~
It's difficult but it can be done by daily practice just like learning to do anything.

Therefore, here I am.
Happy learning! ʕ•́ᴥ•̀ʔっ
Five free ebooks i wish i add earlier when i was a python beginner programmer. Thank me later
Tags: python, beginners
Published: 2021-02-13 04:44:50

Five python free ebooks I wish I add earlier when I was a beginner folks it's very easy to decipher. 
1) programming in python 3 mark summerfield 
2)Begin to code with python  Rob miles
3)learn python the hard way
4) A practical introduction to python programming Brian heiniod
5)Fundamental  of python first programming Kenneth Lambert 

*For advanced programmers I recommend you try *
Python tricks  Dan bader

Thank me later 😀🥰🥰🥳🥳
#python
Dockerfile with fine-tuned Python and native dependencies
Tags: docker, python, bash, virtualenv
Published: 2021-02-13 04:26:14

It's not only about installing Python3 in Docker and use it.

```Dockerfile
RUN apt install python3
```

But it is also about **getting Python version right** (e.g. pyenv, akin to rbenv, nvm, gvm), along with **native dependencies** (yes, usually C++ or C).

People may forget that Python sometimes needs native libraries, which is not really Python; and OS-dependent, e.g. OpenCV, ffmpeg and MeCab. That's why I use Docker - for reproducibility into the remote server.

It is also the answer of this question; but I don't quite know the answer yet...

{% stackoverflow 65768775 %}

## My `Dockerfile`

```dockerfile
FROM debian:buster-slim

RUN apt-get update
RUN apt-get install -y --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

ENV HOME="/root"
WORKDIR ${HOME}
RUN apt-get install -y git
RUN git clone --depth=1 https://github.com/pyenv/pyenv.git .pyenv
ENV PYENV_ROOT="${HOME}/.pyenv"
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"

ENV PYTHON_VERSION=3.8.6
RUN pyenv install ${PYTHON_VERSION}
RUN pyenv global ${PYTHON_VERSION}

RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -

WORKDIR /app

RUN apt-get install -y mecab-ipadic-utf8
RUN touch /usr/local/etc/mecabrc

COPY poetry.lock pyproject.toml ./
RUN /bin/bash -c 'source $HOME/.poetry/env && POETRY_VIRTUALENVS_IN_PROJECT=true poetry install --no-dev --no-root'

COPY . .

ENTRYPOINT [ "/bin/bash", "-c", "source .venv/bin/activate && uvicorn server:app --host=0.0.0.0" ]
```

## What I really wanted to do

1. How do I `source .`, `exec $SHELL` or modify `.profile` / `.bash_profile` in Dockerfile?

Actually, so far, I have found people telling to use [virtualenvwrapper.sh](https://stackoverflow.com/a/42216046/9023855), but no, I don't get it...

```dockerfile
SHELL ["/bin/bash", "-c", "source /usr/local/bin/virtualenvwrapper.sh"]
```
Actually, I did find two ways to manage it.

- `source . && cmd` before every lines - this works perfectly.
- Create a dummy shell wrapper `wrapper.sh`. This seems to superficially work, but it doesn't.

```sh
#!/bin/bash

${1}
${@:2}
```

2. How do I create `ENTRYPOINT` that `source`?

I temporarily made it with the below, but this feels so unbeautiful...

```dockerfile
ENTRYPOINT [ "/bin/bash", "-c", "source .venv/bin/activate && uvicorn server:app --host=0.0.0.0" ]
```
Full Tutorial #7: Setting Up a User Session Query Handler | Microservices Chat App Using React, Node.js, TypeScript and GraphQL
Tags: react, node, webdev, javascript
Published: 2021-02-13 03:40:57

**About Me:** I've been a professional web developer for just over 10 years now. I'm currently the lead web development instructor at [Better Coding Academy](https://codebetter.com.au), and as part of what I do, I post videos on our YouTube channel at [https://www.youtube.com/c/BetterCodingAcademy](https://www.youtube.com/c/BetterCodingAcademy).

_(Subscribe for awesome web development content!)_

Part 7 of the Microservices Chat App is here! In this episode, I set up the `userSession` GraphQL query endpoint to identify whether the user's logged in:

{% youtube TycGWmJ3vsc %}

Happy coding!

Source code: [https://github.com/lucaschen/microservices-chat-demo](https://github.com/lucaschen/microservices-chat-demo)
2021 First Cert | Terraform Associate
Tags: terraform, devops, certification
Published: 2021-02-13 03:23:28

Got my Hashicorp Certified Terraform Associate Cert finally!

The exam is 1 hour long and contains 58 multiple choices questions. It tests you the following knowledge:
• Basic skills in a terminal environment
• Basic understanding of infrastructure components on-premises and in the cloud 
• Familiarity with a scripting language
• Familiarity with basic development concepts
• Access to a cloud provider

I would suggest you understand offical exam objectives (https://www.hashicorp.com/certification#terraform-associate) before attempting the exam. There're not many practice exams available online, but I found a free practice exam (not exam dump) on www.sticker-overflow.com  which is great to validate your knowledge since it has a good coverage. 

Happy coding, happy terraforming!
A Career's Sunset
Published: 2021-02-12 23:43:25

> "Bring anger and pride under your feet, turn them into a ladder and climb higher." - Rumi

For the past decade, I've spent every weekend, and major holiday hunkered down in some of the finest kitchens a major American city had to offer; working towards mastering a craft truly poured myself into. I missed birthdays and funerals, the birth of my niece, among many other life events. This fact is not something distinct to my story, its how professional fine dining kitchens function; which is primarily upon the passion and grit of those who chose this vocation. This time last year I was just about burnt out, being the 'Chef de Partie' at The Four Seasons was an excruciatingly demanding job. By that juncture I had learned just about everything I ever dreamt to know about the culinary world. 

Learning has always been the spark that drives me, I was no longer learning, aptly so I was the one doing the teaching. I've always coveted area's of knowledge where the skill ceiling is practically untouchable. I identified years ago during my undergraduate studies that coding had exactly these qualities. Post college, the job market in 2011 was still stifled by several economic mishaps - so finding a job wasn't exactly panning out for me. For practicalities' sake, kitchens were an easy gig to get, it wasn't before long that I saw all the qualities I admired about my other pursuits in cooking. The rest was history as they say.

Here we are now, full circle. The pandemic gave me the window I needed to slow down and get my priorities straight. I began getting certified by Google in several technical fields, and pivoting my career back to technology didn't seem so out of reach as it once did. I began to feel that learner's mindset returning to me, and with it I knew that I was ready to take on something new once more. The into the fire approach so to speak has always been appealing to me, so it wasn't long before I had fixated on Flatiron as exactly that.

I can extoll upon the qualities I see mirrored in coding from the world of cooking all day, but to be concise I'll spare us. There is an element of creation, making something distinctly yours from raw building blocks so to speak. There is the personal flourish that makes your work its own, and there is the real sense of honing a set of skills that are applicable in the minute and minutia onto then the macro scale. Within coding I recognize the same 'kernal' of possibility and greatness.
Low-cost computer for the kids
Published: 2021-02-13 02:57:23

![Juju playing on his new computer](https://dev-to-uploads.s3.amazonaws.com/i/83kxi8jm15gqr86cpvw7.png)

## Total cost: S$192.8 ($145 or ~₱7,000)

Components:

Dell 22" Touchscreen Monitor S2240T - S$66

![Dell product image](https://dev-to-uploads.s3.amazonaws.com/i/ukr5tkib81sylkl6enab.png)

![Carousell deal](https://dev-to-uploads.s3.amazonaws.com/i/t8nhrr7cxighhky483zu.png)

Raspberry Pi 400 - S$113

![Raspberry Pi 400 product image](https://dev-to-uploads.s3.amazonaws.com/i/6x9ere1e6lup9it6f8ck.png)

![RPi 400 receipt](https://dev-to-uploads.s3.amazonaws.com/i/x78t4okn7yhl3grnh8uu.png)

Micro HDMI to HDMI - S$7

![Micro HDMI product image](https://dev-to-uploads.s3.amazonaws.com/i/dhsuxg2t9izhxh9nv4xk.png)

SanDisk microSD 32GB - S$6.80

![MicroSD product image](https://dev-to-uploads.s3.amazonaws.com/i/ezp3vd4vzefq13j5gm00.png)

The USB-C PD adaptor I use is from my broken RPi4 so it's free.

The S2240T also comes with an audio out jack where I use my old ATH-M50. You can also use a bluetooth speaker with the Raspberry Pi 400.

I installed [Raspbian OS](https://www.raspbian.org/) then [ScummVM](https://www.raspberrypi-spy.co.uk/2017/10/playing-scummvm-games-on-the-raspberry-pi/) to play point-and-click adventure games (perfect for the touchscreen monitor).

The games you can get [here](https://ia801005.us.archive.org/view_archive.php?archive=/13/items/The_Complete_ScummVM_Collection_v2/The_Complete_ScummVM%20Collection%20v2.0.zip) or [here](https://archive.org/download/scummvm-games-collection-complete). Enjoy!
How to fix alsactl store that does not save alsamixer settings
Tags: linux, alsamixer, alsactl, sound
Published: 2021-02-13 02:14:16


These days I had problems with alsamixer settings on my Ubuntu version 18.04.5, it wasnt being restored when restarting the system. I solved the problem by doing this:

Open the alsamixer

1- `sudo alsamixer`

Make the changes you want. Save changes with

2- `sudo alsactl --file ~/.config/asound.state store`

Open bashrc

3- `sudo nano ~/.bashrc`

Add this line at the end

4- `alsactl --file ~/.config/asound.state restore`

save and reboot.
Round 1 Day 1
Tags: 100daysofcode, elixir
Published: 2021-02-13 02:06:38

---
title: Round 1 Day 1
published: true
description: Back to school. Back to school. Learning Elixir.
tags: 100daysofcode, elixir
cover_image: https://cdn.hashnode.com/res/hashnode/image/upload/v1613181428296/AE6zOKS_p.jpeg?auto=compress
datePosted: '2021-02-12'
devToId: 602094
---

## TIL

Currently, during the 100DaysOfCode Challenge, I'm learning elixir. I'll be documenting everything I learn or build as I go. I'm starting off with learning the elixir basics at [ElixirSchool](http://elixirschool.com).

## Basics

- Everything is truthy except for `false` and `nil`
- Booleans are atoms (:true, :false)
- Modules are atoms
- You can access erlang libraries using atoms
- Aka atoms are important :)
- Strings use double quotes
- No modulo operator, but there are the `div` and `rem` functions.
- Each basic type has a rank :/
  - number < atom < reference < function < port < pid < tuple < map < list < bistring
  - I'll never memorize this lawl
- String interpolation "hello #{world}" or "hello " <> "world" ... Pretty Basic.

## Collections

- Lists
  - Mixed types
  - Not unique
  - Linked List → faster to prepend than append
    > In computer science, a linked list is a linear collection of data elements whose order is not given by their physical placement in memory. Instead, each element points to the next. It is a data structure consisting of a collection of nodes that together represent a sequence.
  - List concat `++/2` - cool
  - List sub `--/2` - cool cool
  - Head/Tail - cool cool cool
    - By pattern matching `[head | tail] = list` #=> head is the first element. the tail will be all the others
    - `hd list` #=> returns the first element
    - `tl list` #=> returns all elements after the first
- Tuples
  - Stored with a set amount of memory
  - Access = fast; modification = slow
  - Common for return info from function
- Keyword lists
  - commonly used to pass options to functions
- Maps
  - The Go-to key-value store
  - Similar to ruby's hash
  - Updating syntax is cool?
  - useMap.put/3 to create a new key

## Enum

- Not much to go over here if you are familiar with any other languages Enum methods

## Pattern Matching

- The Holy Grail of Elixir
- If you ask any dev what they love about elixir chances are they will mention pattern matching
- Curveball `=` is actually a match operator similar to the equals sign in algebra :exploding-head:
- [1| tail] = list #=> tail has not been matched so it binds to the last elements of the list

## Control Structures

- `if` and `unless` => straight forward
- `case/2`
  - Similar to `switch`(in javascript) or `case` (ruby) except it uses pattern matching
  - `_` is a catch all like `default` in JavaScript
- `Cond`
  - Used for matching multiple cases similar to an `else if`
- `With`
  - This one is bit trickier coming from other languages
  - Can be used to replace multiple `case` statements
My Daily Side Projects This Week
Tags: webdev, showdev
Published: 2021-02-13 01:28:14

So far I have created 4 little front-end side projects to test out frameworks I am working on.

## Javascript Function Search
The first one was very simple and has the least functionality compared to the others. It is meant to be a site where people submit common Javascript solutions that you can search for. There is no back end for any of the projects because I am testing my Front-end frameworks.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mwvis94crrv7fguhuhl4.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xj8p4ifmn6eliswix41y.png)
## Document editor
The second one I did was a simple document editor. I mainly did it for fun and because I wanted to make a simple content editor to use. You can download and save .HTML files and view them.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/utxens9fsmp8y24mycje.png)
## Hoy (Today) Time Management App
This app prompts you for weekly tasks, what tasks you have to do today, and schedules it all for you in work blocks. This is based on some articles I have read about productivity and work blocks. It is really effective and makes me work a full 6-8 hours of blocks. It also makes loud sound effects when the work blocks or breaks transition.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gb280y90ildct5he57ww.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1sgmci1kd01tr88bcmco.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4pt2e37izm0irmidaq6c.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/i3p2tobu2wu53jsx5x3h.png)
## AppRender (to learn)
Another app I made was one to keep track of things that I am learning and want to remember. I constantly have things I am learning on sticky notes or paper so this is a good alternative.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pbs9v0ceo5xgt3q0ni60.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gxve5e4nmfdgk4ssmvro.png)
AWS IoT EduKit is what? What can we learn from it?
Tags: aws, iot
Published: 2021-02-13 01:13:21

AWS IoT EduKit is a new device from AWS that was launched by AWS re:Invent 2020. Introduce what do we learn from the kit.

2 Benefits, 2 Learn points.

- Eliminates the need to create client certificates and operate CA for IoT core connectivity
- Eliminates the need for measures to prevent leakage of the private key

- How to register to IoT Core with the client certificate in ATECC608A Trust&GO
- How to use the private key in the ATECC608A Trust&GO when connecting to IoT Core

Please see the following blog for details.

{% medium https://ma2shita.medium.com/aws-iot-edukit-is-what-what-can-we-learn-from-it-96039238d712 %}
Happy to join a community of aspiring devs like myself !!
Tags: welcome
Published: 2021-02-13 00:29:57

New here, is this thing on? I'm currently a student at Flatiron School, in my second week & it's better than I expected!! Not only do i finally feel like a developer, I finally have people i can talk to about programming. The experience thus far has been both exciting and frustrating but WORTH IT. I'll keep you guys updated in the weeks to come.
Why bother with "git hygiene"?
Tags: git, productivity
Published: 2021-02-17 09:08:25

---
title: Why bother with "git hygiene"?
published: true
date: 2021-02-13 00:00:00 UTC
tags: git, productivity
canonical_url: https://jhall.io/archive/2021/02/13/why-bother-with-git-hygiene/
---

I’m a big fan of meaningful commit messages.

```
commit ef4d5ce5b6f13a3cc07f8941449bcaf445111cbf
Author: Jonathan Hall <flimzy@flimzy.com>
Date: Thu Feb 11 10:35:34 2021 +0100

    bugfix

```

just doesn’t cut it.

I’m also a big fan of `git rebase` instead of `git merge`, [fixup and ammend](https://www.youtube.com/watch?v=Hf4j7mfCCWo), and a whole host of other git tricks to keep my git history pristine and readable.

But why?

> I rarely find myself doing git archeaology, so why fuss with all this?  
> — Maybe you. Probably someone you work with.

My response:

> I rarely find myself in an automobile accident, so why bother wearing a seat belt?

When you do need it, a clean git history, like a seatbelt, is a lifesaver (although perhaps less literally).
How to check if a string is empty in JavaScript?
Tags: javascript
Published: 2021-02-13 00:00:00

---
  title: How to check if a string is empty in JavaScript?
  published: true
  tags: JavaScript
  date: Sat Feb 13 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/check-if-string-is-empty-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-31d85376cd64479dbf4fe861552e7636.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/check-if-string-is-empty-javascript)
  
To check if a string is empty you can use the strict equality operator (or the triple equals `===`) and compare it with an empty string (or empty brackets `""` ) in JavaScript.

You can do it like this,

```js
// Check if string is empty
if (str === "") {
  // This block of code will be executed
  // if the string is empty
}
```

You might be tempted to do a simple checking with an `if/else` conditional statement without using the equality checking like this,

```js
const str = "";

// Check if string is empty
// without using the === operator
if (str) {
  // This block of code will
  // not be executed
}
```

But here the, `if statement` will not run since an empty string is a falsy value in JavaScript.

See this example live in [JSBin](https://jsbin.com/jehohediwi/2/edit?js,console).

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

---
Authenticating GIT on Development Box
Tags: git, github, beginners, devops
Published: 2021-02-18 17:42:12

---
title: Authenticating GIT on Development Box
published: true
cover_image: "https://i.imgur.com/HyaOzzF.png"
date: 2021-02-13 00:00:00 UTC
tags: git, github, beginners,devops
canonical_url: https://www.rupeshtiwari.com/2021-02-12-authenticating-git-on-development-box/
---

> Are you using windows machine for local development? Do you have Azure DevOp’s server git repo and want to connect from local box? Then read this article.

## Follow steps to Add Window’s Generic Credential

1. Go To Windows Credential Manager

![](https://i.imgur.com/q10uOzt.png)

1. Select add Generic Credential

![](https://i.imgur.com/85vvE8S.png)

1. Enter your on-premise azure devOps server URL and your NT user id and NT user password.

![](https://i.imgur.com/1HsL8mk.png)

1. Now you can clone git source code to local development box.

## Become full stack developer 💻

I teach at [Fullstack Master](https://www.fullstackmaster.net). If you want to become full stack developer and grow your carrier as new software developer or Lead Developer/Architect. Consider subscribing to our full stack development training programs. You can enroll to All-Access Monthly membership plans to get unlimited access to all of our video courses, slides, source code & monthly video calls.

- Please subscribe to[All-Access Membership PRO plan](https://www.fullstackmaster.net/pro) to access current and future angular, node.js and related courses.
- Please subscribe to[All-Access Membership ELITE plan](https://www.fullstackmaster.net/elite) to get everything from PRO plan. Additionally, you will get access to monthly live Q&A video call with Rupesh and you can ask doubts/questions and get more help, tips and tricks.

> You bright future is waiting for you so visit today[FullstackMaster](www.fullstackmaster.net) and allow me to help you to board on your dream software company as a Developer,Architect or Lead Engineer role.

**💖 Say 👋 to me!** Rupesh Tiwari [www.rupeshtiwari.com](https://www.rupeshtiwari.com) ✉️[Email Rupesh](mailto:fullstackmaster1@gmail.com?subject=Hi) Founder of [Fullstack Master](https://www.fullstackmaster.net)
A simple Mattermost notifier written in Go
Tags: mattermost, go, cli, bot
Published: 2021-02-12 23:40:02

I’m very proud to announce the immediate release of **go-mattermost-notify** version 1.0.0, a simple Mattermost notifier written in Go.

You can post text or markdown-formatted messages to a Mattermost *channel* (via its ID) or send *direct messages* to a user.

This program makes use of the Go libraries `http` and `url` for interacting with a Mattermost server (via its REST API v4 interface) and `Cobra` coupled with `Viper` to implement the CLI interface.

Project code available at [GitHub](https://github.com/madrisan/go-mattermost-notify/).