teleren/devto huggingface dataset:
Why we use doctrine package in Laravel
Tags: womenintech, laravel, php, codenewbie
Published: 2021-09-15 17:56:27

Hello all programmer's here.

In this blog post I will describe you why we use doctrine library. This libraryis mostly used for modifying the column of database field with change() method to the to column within the migration file.

__Let us see how to use it__

Before modifying the column we first need to install it using the composer.
```php
composer require doctrine/dbal
```
__Let me describe it with an example for better understanding__:
You have created a migration file to add `is_admin` column in users table like below.

```php
Schema::table('users', function (Blueprint $table) {
    $table->unsignedBigInteger('is_admin');
});
```
But if you want to change the type of the `is_admin` column from `unsignedBigInteger` to `boolean` then you need to add another migration file and add change method to it.

`change` method allow us to modify type and attribute of an existing column refer to the below code.

```php
Schema::table('users', function (Blueprint $table) {
$table-> boolean(‘is_admin’)->change();
});
```
This follwing types can be modified: and supported by doctrine library.

```php
bigInteger, binary, boolean, date, dateTime, dateTimeTz, decimal, integer, json, longText, mediumText, smallInteger, string, text, time, unsignedBigInteger, unsignedInteger, unsignedSmallInteger, and uuid
```

We can also modify a column to be nullable as shown below:

```php
Schema::table('users', function (Blueprint $table) {
    $table->boolean('is_admin')->nullable()->change();
});
```

In this way we can modify the type of the field/column within a migration file.

Happy coding. :unicorn: :unicorn:
Thank you for reading. :lion:
Remove white background in Photoshop 2021
Published: 2021-09-15 17:36:43

Background removal services help beginner and professional photographers, online retailers, business owners, e-commerce, or fashion magazines in batch removing, replacing, and correcting the background. The services reviewed here claim to make your product look professional and suitable for sale or advertising.

We sent the same photograph of the model showing the women tracksuit to 12 different popular background removal services. As a result, we selected 5 companies that really have a nice price-quality ratio. Price, quality, following your requirements, responsiveness, and turnaround are the main aspects that we took into account.

 

Sometimes when you compose a post and copy some material from other web sites or even from Office Word the white background is copied along with the text as background. Due to this the background of post appears white. So how to get rid of this annoying white background in blogger posts. But before i tell you the solution  to avoid such problems in future you can compose your text in Notebook and then copy it rather than using Office.Ok now to remove white background of already posted text follow these steps.
https://clipp-asia.blogspot.com/
Making random ID with Javascript
Tags: beginners, javascript, webdev, reactnative
Published: 2021-09-15 17:27:49

Last week, I needed to find a way to generate a random and unique id to get names for phone files on ios systems. Anyway, googling around, I found this simple function.

All you have to do is call it, where you need to generate the id, and pass the desired length of the id.
And magic! It returns an id made with characters and numbers (in this example, of course!) 

```
const makeRandomId= (length) => {
      let result = ''
      const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
      for (let i = 0; i < length; i++ ) {
        result += characters.charAt(Math.floor(Math.random() * characters.length));
     }
     return result;
  }

```

👉 charAt: The charAt() method returns the character at a specified index in a string.
👉 floor(): The floor() method rounds a number DOWNWARDS to the nearest integer, and returns the result.
👉 random(): Math.random() returns a random number between 0 (inclusive),  and characters.length (exclusive):

> Math.random() used with Math.floor() can be used to return random integers.

That's all! :)
tmux コマンドリスト
Tags: tmux, terminal, cmd, コマンドリスト
Published: 2021-09-15 17:10:24

# はじめに
- tmuxの頻出コマンドリスト + 用語説明
- ()内に筆者の`イメージ`を書いてます。`厳密`には異なるのであくまで`参考程度`に

## 新規セッション作成
- `セッション`とは言い換えると`作業エリア`(セッション)
- `セッション`の中では`画面分割`、`タブ切替`など`キーボード`のみで操作可能
- また複数の`セッション`を作成可能、`プロジェクト`ごとに`セッション`(作業エリア)を`切替`可能
```ruby
# セッション作成
$ tmux new -s セッション名(任意の名前)
# セッション名変更
$ prefixキー + $
```
## セッション削除
```ruby
# 指定して削除
$ tmux kill-session -t セッション名
# すべてのセッション削除
$ tumx kill-server
```
## アタッチ
- 作成した`セッション`に`アタッチ`する(接続する)
```ruby
# セッション一覧取得
$ tmux ls
# セッションにアタッチ(接続という表現がしっくりくる)
$ tmux attach -t 名前
# 上記と等価
$ tmux a -t 名前
```
## デタッチ
- `アタッチ`(接続)中の`セッション`(作業エリア)から`デタッチ`(ログアウト)する
```ruby
# セッションデタッチ(接続中のセッションからログアウトする)
# prefixキーは設定ファイルで変更可能(デフォルトは CTR+q)
$ prefixキー + d
```
## ウィンドウ
- セッション内でタブのような役割をする。
- タブごとに役割を分けるなど結構使う
[![Image from Gyazo](https://i.gyazo.com/817a23c78d3f88d1635fef2c0c983801.gif)](https://gyazo.com/817a23c78d3f88d1635fef2c0c983801)
```ruby
# 新規作成
$ prefixキー + c

# ウィンドウ名前変更
$ prefixキー + ,

# ウィンドウ切替
$ prefixキー + インデックス番号
# 次のウィンドウ 1→2 
$ prefixキー + n
# 戻る 2→1
$ prefixキー + p

# ウィンドウ削除
$ prefixキー + &

# ウィンドウリスト
$ prefixキー + w

# ウィンドウ検索
$ prefixキー + f
```
## パネル
- 画面分割ができる
- ターミナル専用などにして使ったりする
- 筆者はvimで分割しがちなので正直あまり使わない...
[![Image from Gyazo](https://i.gyazo.com/b4a1e69a644865eb488cc6f77842d978.gif)](https://gyazo.com/b4a1e69a644865eb488cc6f77842d978)
```unix
# 画面分割(横)
$ prefixキー + "

# 画面分割（縦）
$ prefixキー + %

# 削除
$ prefixキー + x

# 画面切替
prefixキー + o

# 番号が表示されている間に押す
prefixキー + q 
```
## おわりに
- バッファと設定ファイルはまた別記事で書きます。
- 正直筆者自身上記の２つはほとんど使ってないので、使いこなしだしたら記事を書ます。
Gitlab CI/CD for multiple environment
Tags: gitlab, devops, pipeline, cicd
Published: 2021-09-15 17:07:05

The problem arises when you want to use variables in different situations. A excellent example would be if you wanted to include the URLs of your production, staging, and development databases in the same task but didn't want to write separate jobs for each environment.


When a single procedure (deploy to s3) necessitates multiple jobs for different environments, we have a problem. As a result, managing multiple jobs for a single procedure takes time. So I came up with a solution based on a workflow job. Using a workflow job and a rule condition, we can integrate variable values based on branch. As a result, instead of writing jobs for each environment, a single job can handle multiple environment credentials.

**If you have any questions about this topic, please contact me at santhoshthomas015@gmail.com.**


A sample of code is provided below:
```
image: node:latest
variables:
  GIT_DEPTH: '0' 

stages:
  - build
  - deploy

workflow:
    rules:
      - if: $CI_COMMIT_REF_NAME ==  "develop"
        variables:
          DEVELOP: "true"
          ENVIRONMENT_NAME: Develop
          WEBSITE_URL: DEVELOP_WEBSITE_URL
          S3_BUCKET: (develop-s3-bucket-name)
          AWS_REGION: ************** develop
          AWS_ACCOUNT: ********develop

      - if: $CI_COMMIT_REF_NAME == "main" 
        variables:                                 
          PRODUCTION:  "true"
          ENVIRONMENT_NAME: PRODUCTION
          WEBSITE_URL: $PROD_WEBSITE_URL
          S3_BUCKET: $PROD-S3-BUCKET-NAME
          AWS_REGION: ************** (prod-region)
          AWS_ACCOUNT: ***********(prod-acct)
      - when: always 

build-app:
  stage: build
  script:
     #build-script
  environment: 
    name: $ENVIRONMENT_NAME

deploy-app:
  stage: deploy
  script:
     #deploy-script
  environment: 
    name: $ENVIRONMENT_NAME
```

**NB: Please let me know if this procedure is correct. (Experts)**
Static Site Generator for Text Files: Release 0.1 Note
Published: 2021-09-15 17:00:26

[Static site generator (SSG)](https://jamstack.org/what-is-jamstack/) is undoubtedly one of the trending web development technologies in the last few years. There are already hundreds of them out there.

However, I'd like to contribute a minimal SSG for text files to the open source community. I believe this is a wonderful opportunity to learn about SSG.

Without further ado...

## Silkie
> Static site generator with the smoothness of silk

[Silkie](https://github.com/oliver-pham/silkie) is a simple and smooth static site generator. It can parse text files (".txt" files) and generate HTML files from them.

![Screen Shot 2021-09-15 at 12.44.44 PM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ltsg79fbd26c912wp3t4.jpg)

Check out the [demo](https://oliver-pham.github.io/silkie/dist/The%20Adventure%20of%20the%20Speckled%20Band) generated from this [text file](https://raw.githubusercontent.com/Seneca-CDOT/topics-in-open-source-2021/main/release-1/Sherlock-Holmes-Selected-Stories/The%20Adventure%20of%20the%20Speckled%20Band.txt) (with help from [new.css](https://newcss.net/)).

```
$ python3 silkie.py -h
Usage: silkie.py [OPTIONS]

  Static site generator with the smoothness of silk

Options:
  -v, --version          Show the version and exit.
  -h, --help             Show this message and exit.
  -i, --input PATH       Path to the input file/folder  [required]
  -s, --stylesheet TEXT  URL path to a stylesheet
```

## Features
- Generate HTML file(s) from a specified text file/directory
- Detect the title of a file if it's the first line followed by two blank lines
- Add custom styling to static site

## Getting Started

### Prerequisites

- Python >= 3.9.0
- Pip >= 21.2.4

### Installation

1. Clone the repository
2. Create a virtual environment
    ```
    cd silkie && python3 -m venv .
    ```
3. Activate your virtual environment  
    - **Windows:** `bin\Scripts\activate.bat`
    - **Unix or MacOS**: `source bin/activate`
4. Install the dependency packages
    ```
    pip3 install -r requirements.txt
    ```

## Usage
1. Activate your virtual environment (only if you have not done that)
2. Run the program
    ```
    python3 silkie.py -h
    ```

## Contributing
Feel free to make any pull requests [here](https://github.com/oliver-pham/silkie). For major changes, please [open an issue](https://github.com/oliver-pham/silkie/issues/new) to discuss what you would like to change.

Happy coding!
Welcome Thread - v142
Tags: welcome
Published: 2021-09-15 16:55:06

---
title: Welcome Thread - v142
published: true
description: Welcome to DEV! A thread of hellos and intros.
tags: welcome
canonical_url: 
---

![Ahoy animation](https://media.giphy.com/media/OBCnCi5hN4eJpQzxzC/giphy.gif?cid=ecf05e47yf218azv4b9sk1qtp5zyyfhkxnh5p2l5wguqoivy&rid=giphy.gif&ct=g)

### Welcome to DEV!

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

**Great to have you in the community!**
How to redirect after logged in (simple javascript)
Published: 2021-09-15 16:52:16

i need some help with my code. Basicaly i am not able to redirect after logged in. 
SO i need some help with that.
I used simple html and javascript
html is here and js is down


(index.html)
```
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="login.css">
    <title>Login</title>
    <script src="login.js"></script>
</head>

<body>
     <DIV action="login.html" class="container">
         <form  method="POST" class="login-form">
            <h1 class="login-heading">LOGIN FORM</h1>
             <input type="text" placeholder="User Name" id="login-username">
             <br><br>
             <input type="password" placeholder="Password" id="login-password">
             <br><br><br>
             <input type="submit" value="Login" id="login-submit" onclick="validate()">
         </form>
     </DIV>
    
</body>
</html>
```
/*****************/

(script.js)
```
function validate(){
    var username=document.getElementById('login-username').value;
    var passowrd=document.getElementById('login-password').value;

    if (username === "daksh" && passowrd === 'daksh'){
        alert('You have sucessfully logged in');
        location.href('https://google.com')
        
    } else{
        alert('Wrong username or password');
    }
}
```
Burnout - Sinais de um problema
Tags: burnout
Published: 2021-09-15 16:43:59

Dica de texto sobre burnout e algumas dicas pessoais.

[De olho no burnout: 12 sinais que podem indicar que você tem o problema - 09/09/2021 - UOL VivaBem](https://www.uol.com.br/vivabem/noticias/redacao/2021/09/09/de-olho-no-burnout-12-sinais-que-podem-indicar-que-voce-tem-o-problema.htm)

Notou que algo não está indo bem, algumas ações que podem ajudar:  
  
- Converse com pessoas de sua confiança. Pode ser amigos, parentes, lideres religiosos... o importante é conversar com alguém;  
- Converse com seu líder imediato. Não precisa abrir a sua vida, mas expor o que está ocorrendo pode fazer com ele(a) lhe ajude nesse momento;  
- Procure ajuda profissional. Ninguém melhor do que um psicólogo e/ou psiquiatra para lhe ajudar a entender o que está ocorrendo e como melhorar a situação.
25+ Best CSS Border Effect Examples
Tags: html, css, javascript, beginners
Published: 2021-09-15 16:34:40

Hello Friends, in this article I have listed 25+ Awesome CSS Border Animation Examples. Check out these excellent Border Hover Effect which are available on CodePen.

### How To Create border bottom animation using css

#### Step 1 — Creating a New Project
In this step, we need to create a new project folder and files(index.html, style.css) for creating a Simple Border Hover Effect. In the next step, you will start creating the structure of the webpage.

#### Step 2 — Setting Up the basic structure
In this step, we will add the HTML code to create the basic structure of the project.

```html
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <title> border bottom animation using css</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta https-equiv="X-UA-Compatible" content="ie=edge" />
  <link rel="stylesheet" href="style.css" />
  <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans&display=swap" rel="stylesheet">
</head>

<body>
  
</body>

</html>
```

This is the base structure of most web pages that use HTML.

Add the following code inside the `<body>` tag:

```html
<div class="container">
  <a class="anim-link" href="#">Stackfindover</a>
</div>
```

#### Step 3 — Adding Styles for the Classes
In this step, we will add styles to the section class Inside style.css file

```css
* {
  padding: 0;
  margin: 0;
  font-family: 'IBM Plex Sans', sans-serif;
}
.container {
  width: 90%;
  max-width: 1160px;
  margin: auto;
}
.anim-link {
    display: inline-block;
    color: #000;
    text-decoration: none;
}

.anim-link::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #000;
    transition: width .3s;
}

.anim-link:hover::after {
    width: 100%;
}
```

#### #Final Result
![border bottom animation gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ze60lx8vaf76zhn8ivkd.gif)


### <a href="https://blog.stackfindover.com/css-border-animation-examples/">Check all CSS border effect examples</a>


{% youtube 6ebsLP-pfvA %}
Autocomplete WordPress Hooks in NeoVim
Tags: neovim, vim, opensource, wordpress
Published: 2021-09-24 17:05:02

---
title: Autocomplete WordPress Hooks in NeoVim
published: true
date: 2021-09-15 16:28:56 UTC
tags: neovim,vim,OpenSource,Wordpress
canonical_url: https://daniele.tech/2021/09/autocomplete-wordpress-hooks-in-neovim/
---

My first official project in lua, for neovim

The post [Autocomplete WordPress Hooks in NeoVim](https://daniele.tech/2021/09/autocomplete-wordpress-hooks-in-neovim/) appeared first on [Daniele Mte90 Scasciafratte](https://daniele.tech/eng).
Python Convert Bytes to String
Tags: python, programming, codenewbie, tutorial
Published: 2021-09-16 16:42:34

---
title: Python Convert Bytes to String
published: true
date: 2021-09-15 15:37:28 UTC
tags: #python #programming #codenewbie #tutorial
canonical_url: https://itsmycode.com/python-convert-bytes-to-string/
---

ItsMyCode |

In this tutorial, we will take a look at how to convert bytes to string in Python. 

We can convert bytes to string using the below methods 

1. **Using` decode() `method**
2. **Using `str()` method**
3. **Using `codecs.decode()` method**

## Method 1: Using `decode()` method

The bytes class has a **`decode()`** method. It takes the byte object and converts it to string. It uses the UTF-8 encoding by default if you don’t specify anything. The **`decode()`** method is nothing but the opposite of the encode.

```python 
# Python converting bytes to string using decode()

data = b'ItsMyCode \xf0\x9f\x8d\x95!'
print(data)
print("Before conversion type is", type(data))

# coversion happens from bytes to string
output = data.decode()
print(output)
print("Coverted type is ", type(output))

```

**Output**

```python 
Before conversion type is <class 'bytes'>
ItsMyCode 🍕!
Coverted type is <class 'str'>
```

## Method 2: Using `str()` function

Another easiest way to convert from Bytes to string is using the **`str()`** method. You need to pass the correct encoding to this method else it will lead to incorrect conversion.

```python 
# Python converting bytes to string using str()

data = b'ItsMyCode \xf0\x9f\x8d\x95!'
print(data)
print("Before conversion type is", type(data))

# coversion happens from bytes to string
output = str(data,'UTF-8')
print(output)
print("Coverted type is ", type(output))

```

**Output**

```python 
Before conversion type is <class 'bytes'>
ItsMyCode 🍕!
Coverted type is <class 'str'>
```

## Method 3: Using `codecs.decode()` method

**`codecs `** module comes as a standard built-in module in Python, and it has a `decode()` method which takes the input bytes and returns the string as output data.

```python 
# Python converting bytes to string using decode()
import codecs

data = b'ItsMyCode \xf0\x9f\x8d\x95!'
print(data)
print("Before conversion type is", type(data))

# coversion happens from bytes to string
output = codecs.decode(data)
print(output)
print("Coverted type is ", type(output))

```

**Output**

```python 
Before conversion type is <class 'bytes'>
ItsMyCode 🍕!
Coverted type is <class 'str'>
```

The post [Python Convert Bytes to String](https://itsmycode.com/python-convert-bytes-to-string/) appeared first on [ItsMyCode](https://itsmycode.com).
echoAR partners with SO REAL to provide high-quality 3D objects in AR/VR
Tags: startup, augmentedreality, virtualreality, 3d
Published: 2021-09-15 16:19:59

![1.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1631722512579/Dm7_Puukq.png)

In partnership with [SO REAL](https://www.soreal.ch/), echoAR is excited to introduce in-platform 3D model purchases. Users of [all plans](https://www.echoar.xyz/pricing) can now buy high-quality, game-engine ready 3D models as well as full digital twins inside the console, add them to their project, and then instantly stream & see it in AR!

SO REAL created [The Twinverse](http://twinverse.soreal.ch/), a web-shop for high-resolution 3D objects and home of the highest quality 3D & 4D objects using patented scanning and conversion technology. With our new integration, you are able to buy and import 3D objects directly into your AR/VR/3D project at echoAR, share it with friends, and see it in AR.

## How to find, buy, and add high-quality 3D models in echoAR?

* Go to the [Content page](https://docs.echoar.xyz/web-console/manage-pages/content-page) in the [echoAR console](http://console.echoar.xyz/).
* Clicking the “Add To Cloud” button.

![2.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1631722339748/K8i5Z4TwS.gif)

* Use the dialog’s search box to find 3D models for purchase.
* Look for models with the SO REAL logo and a price tag.

![3.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1631722362016/T_UmI6Wngd.png)

* Choose a SO REAL 3D model and click ‘BUY’.

![4.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1631722384192/Wctjs6IJ5.png)

* Complete the purchase security through Stripe.
* You did it! 🎉 Your content will be displayed in the Content page.
* After buying and adding a 3D model to your project, you are able to [see it immediately in AR](https://docs.echoar.xyz/quickstart/see-it-in-ar) or stream it to your app.

![5.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1631722433109/L1yUaApuL.gif)

![6.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1631722480383/09fETZmnV.gif)

Read more on how to add 3D models in our [documentation](https://docs.echoar.xyz/web-console/manage-pages/content-page/how-to-add-content) and see learn more about SO REAL [here](https://www.soreal.ch/).

***

> echoAR (www.echoAR.xyz; Techstars ’19) is a cloud platform for 3D/AR/VR that provides tools and network infrastructure to help developers & companies quickly build and deploy 3D apps, games, and content.

![7.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1631722494235/d3mQVb0Vf.png)
How to install Figma on Linux
Tags: tutorial, linux, ubuntu
Published: 2021-09-15 16:08:12

[Figma](https://www.figma.com/) is a great UI/UX tool with a quite generous free tier. This means many developers use Figma to prototype their application or website designs (including me). Many of us developers tend to use Linux but that is where a problem arises, the Figma app is not available for Linux!!!

Now, to be fair, Figma has a web version which is almost exactly what the desktop version is but the desktop version is still preferred by most. 

# How do we get the Figma app on Linux?
Well, a great developer thought of solving this issue by making an unofficial version of Figma for Linux and the best part is that it is open source. See the GitHub Repository [here](https://github.com/Figma-Linux/figma-linux). The app is extremely similar to the Windows version of Figma. 

# How is the desktop app different from the web version?
The desktop app is built on electron (both, the official version for Windows and macOS as well as the unofficial version for Linux). The main advantages are better font support, in-app tabs (which is extremely useful for me), and extension development.

# One Small Problem which can be fixed
When you are installing Figma Linux on Ubuntu, you might use the PPA repository way. This way seems to have issues and Figma won't launch. If you ever try to launch it from the terminal, you will see this error -
```text
figma-linux: error while loading shared libraries: libffmpeg.so: cannot open shared object file: No such file or directory
```
So what is the fix? 
Don't use the PPA!!!
Get the `.deb` package from the [releases page](https://github.com/Figma-Linux/figma-linux/releases)
If you have already downloaded from the PPA, you can simply overwrite it by installing the .deb (It might ask you to downgrade, doing that will also work). We also need to hold it off `apt upgrade` or else it will automatically update and cause the issue again.

To do this run the following command - 
```bash
sudo apt-mark hold figma-linux
```

And that is it!!! The issue is fixed and I hope Figma Linux works well for you. If you have any doubts, you can leave down a comment below. For bugs, submit a GitHub issue [here](https://github.com/Figma-Linux/figma-linux/issues)
React Native Android Currency Formatter
Tags: reactnative, javascript, android
Published: 2021-09-15 16:06:41

---
title: React Native Android Currency Formatter
published: true
description: React Native Android Currency Formatter. Native Module for a currency format with specified FORMAT locale.
tags: reactnative, javascript, android

---
Hey, Devs!

I will appreciate any feedback about this package.

https://www.npmjs.com/package/react-native-android-currency-formatter