teleren/devto huggingface dataset:
Farsite is a blockchain-powered sandbox 
Tags: farsite, raquezha, nft, blockchain
Published: 2021-08-06 16:25:32

---
title: Farsite is a blockchain-powered sandbox 
published: true
description: a new blockchain-powered sandbox MMO RTS game
tags: farsite, raquezha, nft, blockchain
//cover_image: https://direct_url_to_image.jpg
---

Farsite a new blockchain-powered sandbox MMO RTS game with elements of adventure in a sci-fi setting based on a post-apocalyptic story!

Register now! https://farsite.club/u/raquezha
My Experience with a Drupal 8/9 Update Part 3: Database Updates
Tags: webdev, php
Published: 2021-08-06 16:18:56

<a href="https://dev.to/nevkatz/my-experience-with-a-drupal-8-9-update-c8j">Part 1</a> | <a href="https://dev.to/nevkatz/my-experience-with-a-drupal-8-9-update-part-2-the-remote-site-12c7">Part 2</a> | Part 3

Thanks for stopping by. This is my third post in a series detailing my experience with updating our 24-site multisite system from Drupal 8 to Drupal 9 this week in our staging environment. I hope you come away with a little insight on how to handle this in your own projects or on website upgrades in general.

The Drupal 8/9 transition has consisted of two main parts: the codebase upgrade and the database upgrade.

The codebase upgrade was challenging when I tried to migrate directly from Drupal 8 to Drupal 9 due to version conflicts with Composer. After hitting these roadblocks, I ended up switching my approach and starting from with a Drupal 9.2.3 Vanilla site, re-adding the modules and themes. This was the way to go, as most of the Composer updates were smooth after that with minimal dependency issues.

Since then, our work has been primarily focused on making database updates to each of the 24 sites.

One surprise from this upgrade was how many updates were needed to our site's theme. In addition to changing the versioning, there were several places where we had to change the syntax in our Drupal API calls. Fortunately, Acquia Cloud, our server provider, has a nice log system that allowed me to check into the errors resulting in the white screens I encountered during our database updates. 

Another interesting find was that layout builder was automatically enabled for our homepages, which caused our homepage text to be hidden. Figuring out how to turn it off was tricky at first, but I ultimately found a way to do it with two clicks and a save.

One question I have yet to contend with is how best to handle local development. Now that Acquia Dev Desktop has reached EOL, I am trying out Lando. The caveat is that setting up multisites with Lando looks complex. I'm going to give it a try with just one site to see how it goes. 

I have been focusing on database updates over the past 24 hours and they have gone fairly smooth. Every so often there is a module I need to add or a theme issue I need to resolve, but for the most part everything works and I can plot out our roadmap - as opposed to when I was starting, where I couldn't see two feet in front of me. As a result, I am now able to coordinate with our program sites around the globe to make sure we can handle any content updates that occur between now and deployment.

We are just about nearing the finish line, and this has been quite a learning curve. I hope my experience is informative for other Drupal devs looking to upgrade their sites from 8 to 9.

### Elsewhere

<a href="https://medium.com/geekculture/7-tips-on-upgrading-from-drupal-8-to-drupal-9-648f519d6e7e?sk=fe2d0816cb852a7b5ca3dfaf0b6fa131">7 Tips on Upgrading from Drupal 8 to Drupal 9</a>
tmux rename session
Tags: cli, linux, tmux
Published: 2021-08-06 16:13:15

---
tags: ['cli', 'linux', 'tmux',]
series: tmux
title: tmux rename session
canonical_url: https://waylonwalker.com/tmux-rename-session/
published: true
---

So you have been working on your tmux workflow, you've dropped a too many window workflow for scoping work that belongs together into separate sessions, but you cannot remember what session your work is in. If your diligent you have named your window when you created it, but sometimes its intent has changed or your were just plain too lazy at the time for the extra characters needed to name it.  Don't worry we can still give that session a descriptive name.

Let's rename some sessions in the terminal.

``` bash
# rename the current session to me
tmux rename-session me

# rename the me session to scratch
tmux rename-session -t me scratch 
```

There is a default keybinding that you can use `<prefix>+$` to rename the current session in the tmux command line.

``` bash
bind-key          $ command-prompt -I #S "rename-session '%%'"
```

I've also had this keybinding kicking around for years, but I rarely use it anymore. You will see why in an upcoming video.

``` python
bind -n M-W command-prompt "rename-session '%%'"
```

Be sure to check out the full YouTube playlist and subscribe if you like it.

[![tmux playlist on youtub](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v4cgo76y53s1hwykajo1.png)](https://www.youtube.com/playlist?list=PLTRNG6WIHETB4reAxbWza3CZeP9KL6Bkr)

{% post https://dev.to/waylonwalker/how-i-navigate-tmux-in-2021-2ina %}

> Also check out this long form post for more about how I use tmux.
Tip: NuxtJS + Django DRF
Tags: python, django, nuxt
Published: 2021-08-06 16:11:23

Piccolo tip del giorno come configurare [nuxtjs](https://nuxtjs.org/) con l'autenticazione in django drf

- Inserire nel file di configurazione:*nuxt.config.js*

```javascript
auth: {
    strategies: {
      cookie: {
        endpoints: {
          login: {
            url: 'auth/login',
            method: 'post',
            propertyName: 'user',
            withCredentials: true 
          },
          logout: { 
            url: 'auth/logout', 
            method: 'post' 
          },
          user: { url: 'auth/user', method: 'get',propertyName: false},
        },
        redirect: {
          login: '/login',
          logout: '/login',
          home: '/',
        },
      },
    }
  },
```

- Creare nella cartella *plugins* il file axios.js

```javascript
export default function ({ $axios }) {
  $axios.defaults.xsrfHeaderName = 'X-CSRFTOKEN'
  $axios.defaults.xsrfCookieName = 'csrftoken'
}
```

Questo permetterà all'applicazione in nuxtjs di autenticarsi attraverso una sessione in django.
Should You Really Learn Vanilla JavaScript Before React?
Tags: javascript, react, webdev
Published: 2021-08-06 16:08:07

"Learn the basics before you learn React", they say. But if you're a beginner who's learning with React first, you probably start to worry. You might start asking if you're learning everything the wrong way.

The thing is, **if you're learning React before the basics, chances are that you're doing it right.** And that's because it all boils down to your personal learning style.

Basically, **devs can learn things in two ways: bottom-up and top-down.** A bottom-up learner feels more comfortable learning the basics (i.e. JavaScript, HTML, or CSS) first. They only start learning the libraries after they feel confident with the fundamentals.

On the other hand, a top-down learner prefers learning the frameworks first. The framework patterns help them learn the fundamental libraries and languages under the hood.

## What's Your Learning Style?

And now, the question is: what's the best learning style for you? Of course, there's no one-size-fits-all answer, you'll have to find the answer for yourself.

**The best way to find out is to try both approaches, and check which method helped you learn better.** Or if you're already trying to learn things and you're facing too many challenges, try the opposite approach.

The only caveat here is: some top-down learners might put off learning the fundamentals, even after they became proficient with the framework. I strongly recommend that you **don't put off learning the fundamentals.**

Learning the basics helps you a lot when you have to find and fix bugs in your code. No matter if you learn them before or after, what counts is that you do know them.

---

Become a Better JavaScript Developer! My newsletter has easy, actionable steps to level up your JavaScript skills, right to your inbox. [Click here to subscribe](https://nicozerpa.com/newsletter)
Revamped HackerNews !
Tags: codenewbie, programming, webdev, app
Published: 2021-08-06 16:06:43

Came across this recently : https://bit.ly/3jucY7X

So, will be building: A Revamped HackerNews !

Also thinking of using a DB to let users bookmark posts with a profile page of every user, thus making it full stack.

Goals :
- To learn NextJS by building an app.
- To make a PWA for use on phones.

What are your thoughts or any feature suggestions?
Beginners Guide to Building a PHP Web Scraper Using Goutte 
Tags: php
Published: 2021-08-06 15:57:20

Why Using Goutte for PHP Web Scraping?
You already know we’re going to use Goutte for this example – spoilers from the title -, but do you know why?

Guzzle is definitely a great option for web scraping. It simplifies making the HTTP request and has the ability to parse the downloaded file to extract data.

The problem is that to make it happen, we would have to turn the downloaded HTML file into a DOMDocument and then use XPath expressions to navigate the document to select the nodes we want to get.

These add extra steps that we can overcome easily using Goutte instead.

https://www.scraperapi.com/blog/simple-guide-to-building-a-php-web-scraper-using-goutte-for-beginners/
React for PWA apps
Published: 2021-08-06 15:38:02

Hi All

Please forgive what seems like a really basic question. I am investigating trying out PWA for mobile apps with React.  There are loads of tutorials but they all assume the development environment is already installed. I'm coming from Delphi, Visual Studio, Android Studio etc. where there are installed environments but I simply can't work out where you write code for React.

Can anyone point me in the right direction?

Thanks
Andy
Easy data validation with with Valdi in Elixir
Tags: elixir
Published: 2021-08-06 15:26:59

> Credit: this icon is from [flaticon.com](https://www.flaticon.com/free-icon/parking-barrier_2983600)

In previous article, I shown you how to implement you own validation module. I you haven't read it, you can find it here [How to build an Elixir validator from scratch ](https://dev.to/bluzky/how-to-build-an-elixir-validation-module-from-scratch-102m)

And I think some of you may want a ready to use library so I wrapped it up, added some useful api and published on [hex.pm](https://hex.pm/packages/valdi) and [github repo here](https://github.com/bluzky/valdi).

This post is just showcases of what it can do. (not too much fancy)
First, add dependencies to your `mix.exs` and you are ready to go.

```elixir
{:valdi, "~> 0.2.0"}
```

And this is how it works.

**Validate using a specific validation function**

```elixir
iex(1)> age = 20
20
iex(2)> Valdi.validate_number(age, min: 18, max: 60)
:ok
```

But most of the time you don't do this, you will want to combine multiple validations at a time.

```elixir
iex(4)> Valdi.validate("20", type: :integer,  number: [min: 18, max: 60])
{:error, "is not a integer"}
```

And you may want to validate a list of value too:

```elixir
iex(1)> Valdi.validate_list(["hi", "how", "are", "you", 100], type: :string,  length: [min: 3])
{:error,
 [[0, "length must be greater than or equal to 3"], [4, "is not a string"]]}
```
If validation failed, you got a list of error and index of error item.


`Valdi` supports you to validate a simple map with given specification:

```elixir
product_spec = %{
    name: [type: :string, required: true],
    sku: [type: :string, required: true],
    price: [type: :integer, number: [min: 0]]
}
Valdi.validate_map(%{
    name: "A magic pen",
    sku: nil,
    price: -1
}, product_spec)

# {:error, %{price: "must be greater than or equal to 0", sku: "is required"}}
```

**Valdi does not support nested map validation**.

You might want to take a look at [Contrak](https://github.com/bluzky/contrak), it extended `Valdi` by providing a simple way to define and validate nested schema.

Why I didn't put those in just one library? I think data validation and schema validation are quite different, so I want to keep libraries simple and do its best thing.


**Here you can define your own validation**

```elixir
Valdi.validate("as008x8234", type: :string, func: fn value ->
   if String.match?(value, ~r/^\d{4}$/), do: :ok, else: {:error, "not a year string"}
end)

# {:error, "not a year string"}
```

Hope this small library can help. If you have any suggestion please comment.
Thank you.
What is YAML File?
Tags: docker, devops, security, sre
Published: 2021-08-06 15:19:26

###YAML (Yet Another Markup Language):

YAML is an indentation-based markup language. If you are a developer then maybe you saw this file or hear about it. So let's start pros and cons of the YAML file. Mostly the DevOps engineers are using this file besides this also developer now using YAML. Many Developers using this file because of its readability, simplicity, and good support for many programming languages.  
Here is an example:
***info.yml***

```
---
personal:
  name: Nipu chakraborty
  age: 24
  address: Bangladesh, Dhaka
  phone: '0182XXXXXXXXX'
  email: nipu@nipu.me
professional:
  skill:
  - javascript: 3 Year
  - nodejs: 3Year
```

When you create and YAML file it's extension should be .yml. You can see here the YAML file started with --- (triple dash).Triple dashes use (“---”) to separate directives from document content. that means these dashes indicate the start of a new YAML document. you can use multiple ("---") dash for create new document in a file. 

##Scalars, or variables:
You can write in YAML file, String , Number, Boolean type data. 

##Conclusion:

1. YAML is a data-oriented mark up language what support in multiple language 
2. You can convert YAML file easily in JSON formate.
3. It's helpful for Docker compose & also CI/CD
MAKING A CLASS LEVEL ACTIVERECORD CHAINABLE SCOPE METHOD
Tags: tutorial, rails, codenewbie
Published: 2021-08-06 15:05:54

This is how to make a class level ActiveRecord chainable scope method from what is a scope to implementation.

First, I had to find a good definition of scope method. I found one [here](https://medium.com/@pojotorshemi/ruby-on-rails-named-scope-and-default-scope-74ee3db2a15f#:~:text=In%20Ruby%20on%20Rails%2C%20named,to%20query%20Active%20Record%20database.&text=Like%20Ruby%20class%20methods%2C%20to,it%20on%20the%20class%20object). Ok. This definition brought up another thing that I don’t understand, lambdas, so let’s find a good article about those. [This blog](https://blog.appsignal.com/2018/09/04/ruby-magic-closures-in-ruby-blocks-procs-and-lambdas.html) explains how to get from a method to a proc to a lambda. Great! Now we’re in business!

The next thing I’m going to do is look at my models for a validation that I can call either Model.order or Model.where on. For more information on these two ActiveRecord queries go [here](https://guides.rubyonrails.org/active_record_querying.html). Fortunately, I have a year table in my Car model that I can order either ascending or descending to get the oldest or the newest car in my database.

![Car Scope](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cmk9nnrwntu1db66dl2x.png)

Now how do I use this and chain it?

![Car Scope](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9alz69fqa5lj0phvr8eb.png)

In the example above, I used the scope in one of my views. I then used interpolation to call on Car.oldest_car in order to access the year, make, model, the path for the link_to, and another class for the owner name. These are the results of my scope methods...

![Car Scope](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mv2k1nhxystvltchlwmn.png)
Design in minutes.
Tags: patterns, constructor, illustration, geometric
Published: 2021-08-06 14:59:31

Geometric Seamless Pattern Constructor is a system for the easy creation of colourful geometric patterns that can be used in web or graphic design projects. With Figma, all you need to do is plug in your colours.

![smartmockups_ks0h1uix](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jr83ynbrpwala2ekym6u.jpg)
 
 
## Features:
### Design in style
Geometric Seamless Pattern Constructor is a set of patterns made with Figma and it's easy to use. You can customize all colours, sizes and positions of the pattern parts.
A wide selection of colors and styles for your seamless patterns.

![smartmockups_krz2udi2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8t434drjjpzhsmkyovp7.png)
 

### One pattern, infinite possibilities. 
With the Geometric Seamless Pattern Constructor, you'll have access to a wide selection of colors and styles for your seamless patterns. Perfect for a variety of graphic design projects or web product designs!

![smartmockups_krz2lkkg](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iq7obrtsk9oj0qp7ydag.jpg)
 

### Cut costs and save time with one tool.
The Geometric Seamless Pattern Constructor lets you cut costs and save time on your design process. With bright colors, instant design updates, and the ability to export patterns to Adobe Illustrator, Sketch, or Photoshop CC for editing, this tool is perfect for both freelance designers and product teams!

![smartmockups_krz2ritm](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wiwn4n5eg1ab40xay2d3.jpg)
 

### Create endless color combinations
Use your creativity to create a seamless pattern with any colours in the world. The Figma file contains assets and building blocks made as components with variants, that make your design process fast and easy. All colours are in styles and can be fully customized.

![smartmockups_krz3dugc](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kptqznu4p2w8y10m7rnh.jpg)

Design something beautiful with our system.
 
Let your creativity start breath!

You can find the file at [hotsnow.fi](https://hotsnow.fi/geometricpatternconstructor) site.

Please share this article to anybody who will find it useful.
Event loop and queue
Tags: javascript, node
Published: 2021-06-25 04:59:18

> JavaScript is a single threaded language so how does it handle processes that require multi threads?
 **LETS FIND OUT**

<h2> Why do people say JS isn't a stand alone language? </h1>

The first thing that comes to our mind is JS needs an environment to run (node or browser), so we call it dependent language.

So basically JS is a single threaded language so how can it perform api or any processes that require another thread? 

**IT CAN'T** 

But when its run on browser or node environment, it takes help of something called event loop. 

<h3> What is event loop?  </h3>

![Screen Shot 2021-06-25 at 9.17.00 AM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pvttj4j1k2h79yo28d9n.png)
 
Before we get into the understanding of event loop. It's ideal to understand how call stack works. *(will make another blog on call stack or please refer to another blog on call stack)*. 

Any process that is async goes into the call stack. It is directly thrown into the event loop and new call stack is formed to call the next process. 

**What happens in the event loop?**

The event loop is something that is at core done by c++ and c to do the non-blocking I/O operations that couldn't be done with vanilla JS. 

It would be easier to understand doing it with an example. 

Let's take the most basic function of asynchronous call which is setTimeout().

Step 1: 
       setTimeout() first goes into the call stack.

![Screen Shot 2021-06-25 at 9.40.00 AM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/irgl80sng1ko22smsd6j.png)
 

Step 2: Since setTimeout is an async call it gets put in the event loop immediately. 
![Screen Shot 2021-06-25 at 9.41.47 AM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y8b0qj587jw7wl8yo5b9.png)

Step 3: Now the call stack looks for the next process while the setTimeout() process is happening in the event loop. This is what they call async programming. Doing multiple tasks at the same time. 

Once the process in the event loop is done. It goes to the event queue so that the call stack can pick it up once there are no more processes left for the call stack to read. 


![Screen Shot 2021-06-25 at 10.16.25 AM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g9xtgw40sfi32osiotpa.png)

Once no more processes are left for the call stack, the event queue then pushes the call backs to the call stack so that the script can finally end.
SQLite: A tool that allows creating databases from the terminal  
Published: 2021-08-06 14:43:05

I had learned how to create a table for a new database using tools like Excel, Matlab, My sql and table plus.

Now, with `SQLite` I can create the databases in a very practical way, it is similar to `Mysql`, so today I a practical example, comparing `Mysql` with `SQLite`,

1. We must be in the folder where we will create the database:

To `SQLite`

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

in the case of `Mysql`, you must find the location of the program to be able to execute it
```
brew search mysql
//or
./mysql -u root -p
```
2. Open the tool, giving name to database:

To `SQLite`
```Terminal
~ sqlite3 mydatabase
```
in the case of `Mysql`
```
~ create database mydatabase
```

3. Create new table, taking into account the type of the column:

`SQLite` and `Mysql` are the same

```
~ use mydatabase
~ create table dataUsers(
          Id integer primary key,
          Name text,
          Last_name text,
          age integer,
          Cell integer 
)
```
4. insert the data:

`SQLite` and` Mysql` are the same
```
insert into dataUsers(0001,'Ema','Garces', 21, 0573033333055 );

//or

insert into dataUsers( Name text,Last_name text, age real, Cell integer ) VALUES (0001,'Ema','Garces', 21, 0573033333055);
```
5. Show table:

To `SQLite`
```
~ .mode {mode of choice}
~ select * from dataUsers; 
```
there are several view modes to display the table:
ascii, box, csv, column, html, insert, line, list, tabs, tcl, etc.

in the case of `Mysql`
```
~ show tables;
~ describe dataUsers;
~ select * from dataUsers; 
```

6. Bonus: Connect to database with table plus

6.1 open table plus:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vt87wz16b9dfm9ciao33.png)
6.2 create new connection:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zephts7lzwp4wdf8e531.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ebtrbb2rpmnegmwmu7ii.png)
6.3 name the connection and find the location of the database:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ez76pif8qw90un2xkxl1.png)
Beginner With Questions
Tags: help, javascript, python, webdev
Published: 2021-07-20 23:43:52

Please bare with me, I do a lot of reading, research, etc but still find myself lost. I learn differently and just having some difficulties for the moment.

Is it still possible to create browser based games, strictly on an iPhone and iPad? Due to random events, I can not currently use my PCs. Just looking to try making some side income before I continue my work on fixing my other devices.

The plan is to use JavaScript or even Python, but I keep seeing all these recommended APIs or other things like Phaser, Node, etc that says they need to be downloaded. It's really confusing me to be honest, I'm trying my best to learn development and I refuse to give up, just kind of becoming frustrated.

Should I use Github for any of that? I don't even know Github yet, just kind of wanting to do the coding on my own to fully learn to better myself for the future.

I started with Unity, but it created problems, hence me only having the iPhone and iPad at the moment.

I don't know programming too tell, so I'm trying to have this as a project to learn more and be able to move forward, I just try reading resources and they always refer to other things and use this, use that.. I just want to be able to learn to code, using other things doesn't do that in my opinion..

Thanks for reading, tons of questions and things to ramble about. Tried keeping it short and on point.