teleren/devto huggingface dataset:
Learn Advance SEO Course 2021
Tags: seocourse, adventofcode
Published: 2021-04-22 05:19:35

Doing an <a href="https://www.hitechdigitalservices.com/seo-training-institute-delhi/">Advance SEO Course</a> from the best SEO training centre will help better your business's visibility on the web, managing to stand out among your main competitors and capturing your target audience's attention.

Do one among the person who is running SEO business? Wanna have the right position of your website? Then hiring the freelance SEO services Delhi is the best choice. It not only provides suitable services but it also acts as a helping hand for your business to achieve great heights. With the best search engine optimization, the seo services are going to help you to take your website to the top of search engine result page. 

And there are many benefits which are there with hiring the SEO freelancers. Do you know some of the benefits that are there with hiring the SEO services towards the website? No! Then you don’t have to move to anyplace when you want to know about the benefits. In the article here are some of the benefits which are there with hiring the freelance Seo services in dwarka delhi. 

The main plus point of hire SEO freelancer is working with flexibility. However, you can easily communicate with the SEO expert anytime when you have any query. And you can talk about the progress which is there with the project. Also, here you can ask about the next strategies with the keywords ranking and different other features. There are people who think that SEO companies only respond during the office hours. But freelancers can work at anytime when you ask support for them.
Protecting API keys in Flutter
Tags: flutter, security, inthirtyseconds
Published: 2021-04-22 05:00:43

It is always a fear that one day you might end up leaking your API key in a public git repository. In flutter is there are many ways of hiding the API key some are not working and some don't work properly in this article I will be showing you one way to work with API keys in flutter.

## Let's see how we can do it
We will be using [this package](https://pub.dev/packages/flutter_dotenv)
If you are using it in a project **with null safety** 
```yaml
dependencies:
  flutter_dotenv: ^4.0.0-nullsafety.0
```
If you are using it in a project **without null safety** 
```yaml
dependencies:
  flutter_dotenv: ^3.1.0
```
then create a file in the root directory called `.env`
> For those of you who don't know **what a `.env` file is** it is basically a file in which we store secret variables.

In the `.env` file you can add your secret API keys in this format
```
SUPER_SECRET_API_KEY=This is a super secret API key 
THIS_CAN_BE_CALLED_ANYTHING=This here can be anything like ut4ihyeFn49
```
> **Important**: Never commit these .env files in your version control.
If you are using git version control system add the `.env` file to `.gitignore`

After making this `.env` file add it as an asset in the `pubspec.yaml`
```yaml
assets:
  - .env
```
Then run
```sh
flutter pub get
```

In your `main.dart` file load the `.env` file
```dart
import 'package:flutter_dotenv/flutter_dotenv.dart' as DotEnv;

Future main() async {
  await DotEnv.load(fileName: ".env");
  //...runapp
}
```
Now in your code you can load the variables from the `.env` file anywhere like this.
```dart
import 'package:flutter_dotenv/flutter_dotenv.dart';
env['SUPER_SECRET_API_KEY'];
```

> That's it, thanks for reading hope this short article helps!
Checking conditions using Array.some()
Tags: javascript, todayilearned
Published: 2021-04-22 20:26:03

---
title: Checking conditions using Array.some()
published: true
date: 2021-04-22 00:00:00 UTC
tags: javascript, todayilearned
canonical_url: https://declanbyrd.co.uk/journal/2021/array-some/
---

Today I learnt how to use `Array.some()`.

The problem I was facing involved a function that took a user input of type string and the purpose of the function was to loop through an array containing strings, returning true if the user input contained a string from the array or false if there were no matches. The user input string would represent a hierarchical structure similar to `"continent/country/city"` while the items in the array could be a continent, country or city.

In pseudo code the problem looks like the snippet below:

```
function doSomething(userinput) {	
  for each string in the array { 
    does userInput contain the string? 
    if yes { 
        return true; 
    } 
    else { 
        check next string 
    }
  }
  if userInput did not match any string in the array { 
    return false
  }
}
```

While the pseudo code could have been translated into JavaScript, writing the logic and then verifying it works correctly would have been worthy of its own unit test - something I don't mind doing but would rather not if there is an existing API that can be used. I then started looking through the [MDN Web Docs](https://developer.mozilla.org/en-US/). Ideally I wanted an API similar to `string.includes()` that would allow me to pass an array of strings as a parameter.

## Array.some()

The [Mozilla documentation for Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) states that:

> "The **`some()`** method tests whether at least one element in the array passes the test implemented by the provided function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array."

This was ideal an idea solution to my problem. By using `some()` I could then pass a function that would check if the user input string contained any of the strings from the array.

I was then able to apply the `some()` method, resulting in JavaScript code that looks like the snippet below:

```js
const filters = ['England', 'France', 'Spain'];
const test1 = 'Europe/England/Brighton';
const test2 = 'Europe/Italy/Rome';

function doSomething(userInput) { 
  return filters.some((filter) => userInput.includes(filter));
}

doSomething(test1);    // returns true
doSomething(test2);    // returns false
```
49 Days of Ruby: Day 26 - Pattern Matching
Tags: ruby
Published: 2021-04-22 04:53:43

---
title: 49 Days of Ruby: Day 26 - Pattern Matching
published: true
description: Join us on a 49 day learning journey through Ruby!
series: 49 Days of Ruby
tags: #ruby
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/9m73qaetuse3nm3y3it8.png
---

**Welcome to day 26 of the 49 Days of Ruby! 🎉**

Patterns! Today we are going to discuss the exciting topic of *pattern matching* in Ruby.

Pattern matching is a relatively new phenomenon in the language. It was introduced in Ruby 2.7, and further enhancements have continued through to the Ruby 3.0 major release.

## What is pattern matching?

> Pattern matching is searching for a given sequence.

It allows for matching inside objects for a specific content structure.

Pattern matching can be a very helpful tool and offers you a lot of powerful utility as you build out applications!

## Pattern matching in Ruby

How do we implement pattern matching in Ruby?

The basic structure is the following for a pattern matching statement:

```ruby
case statement
in pattern ...
  ...
in pattern ...
  ...
else
  ...
end
```

It starts with the statement or expression that we are matching against: `case [1, 2]`

Let's take a look at an example from [Woman on Rails](https://womanonrails.com/ruby-pattern-matching):

```ruby
case [1, 2]
in [2, a]
  :no_match
in [1, a]
  :match
end
# => :match

> a
# => 2
```

In the above example, we are matching against an array of two integers. We look for two versions of that array: `[2, a]` and `[1, a]`.

The array we're matching against fits the second `in` clause. Thus, when we match against `a`, the return value is `2`.

Another great example is matching inside of a hash:

```ruby
case { coffee: "Americano", tea: "Earl Gray" }
in { coffee: "Americano", tea: "Green" }
  :no_match
in { coffee: "Americano", tea: x }
  :match
end
  # => :match

> x
# => "Americano"

```

There is **so much more** to learn about pattern matching in Ruby! Check out the [Ruby docs](https://docs.ruby-lang.org/en/3.0.0/doc/syntax/pattern_matching_rdoc.html) to see a lot more examples of use cases!

That's it for today. See you tomorrow!

**Come back tomorrow for the next installment of 49 Days of Ruby! You can join the conversation on Twitter with the hashtag [#49daysofruby](https://twitter.com/hashtag/49daysofruby).**
【Redis Week】 - 7 Days Best Practice With Alibaba Cloud ApsaraDB - Day03
Tags: database, redis, webdev, java
Published: 2021-04-22 04:51:24

Learn best practices of Redis in 7 Days

### Day 3 - Rules You Should Follow & Issues You Should Know When Developing With Redis
[Watch Now (30 mins)>](https://www.youtube.com/watch?v=eSOh3YV-joA&lc=UgzS_JP2BkovlGItcKh4AaABAg)

> This video is in Chinese, and it's free. The contents are suitable for all developers (especially java developers). For English speakers, we recommended to click the playlist in the end of the video or you can click the link below to start learning directly.
[Best Practice of Redis (EN)>](https://www.youtube.com/playlist?list=PL54EFTJJZrwgfve8XuYSKTnIfve08WmfN)

### Main Contents
1. Why we need Development Specifications for Redis related developers?
2. What are the Redis develop rules we use in Alibaba Group?
3. What are the most common issues for Redis developers? how to deal with these problems?
eg. Memory use statistics, jitter, slow SQL management and more.

### Light Gifts
Redis Free Trial for all Redis beginners and Redis experts.
[Get the Free Trial](https://www.alibabacloud.com/campaign/free-trial)
Use a Webcam on Raspberry pi with 3 Commands
Tags: raspberrypi
Published: 2021-04-22 04:47:02

Recently I reinstalled Raspberry Pi OS on my micro SD to build a security system for my room lol.

As the first step, I tested my webcam(old CREATIVE) with 3 commands.

## commands 

```zsh
$ sudo rapi-config
interface enable camera
$ sudo apt-get install guvcview
$ guvcview &
```

I also updated my Raspberry Pi setup note on GitHub

{% github koji/RaspberryPi-Note %}

I will add a python script for moving detector with webcam.
after selecting any one option, the others become unselectable(disable) 
Tags: javascript, jquery, css, html
Published: 2021-04-22 04:45:59

How to do this, after selecting any one option, the others become unselectable(disable) . Please hint according to the given code snippet.
 $(".mcq").on("click","li", function(){
     $(this).addClass("select");
where 
.mcq li.select {
 background:#68c9c6;
 color:#fff;
 animation:zoomOut 300ms ease;
}
Create Alibaba Cloud Startup Program Is Live!
Tags: alibabacloud
Published: 2021-04-22 04:40:05

Just a quick mid-week update to let you all know that new Startup Program is live! This is a great way to get **free benefits** if you are a startup using or planning to use Alibaba Cloud. You can find details here: https://www.alibabacloud.com/startup/index

[APPLY NOW!](https://www.alibabacloud.com/startup/join-us?spm=a3c0i.7989283.1676686870.1.3f6828c633w4Ib)
Alibaba Cloud’s Academy Day for Europe, the Middle East, and Africa (EMEA)
Published: 2021-04-22 04:31:04

Don’t miss Alibaba Cloud’s Academy Day for Europe, the Middle East, and Africa (EMEA) coming up on May 19th!

Sign up here: https://www.alibabacloud.com/campaign/digital-academy-day-emea-2021

Come check it out!
FREE GitLab Certified Associate Self-Study + Exams
Tags: gitlab
Published: 2021-04-22 04:27:28

Usually priced at USD $650 it's available for free with discount code E6B8A234458AE3D795 until April 30, 2021.

Steps required:

1) Create account on https://gitlab.edcast.com/ (1.) purple login button, 2.) purple signup button)

2) Add https://gitlab.edcast.com/pathways/cy-test-pathway-associate-study-exam/ to basket

3) In Payment step apply discount code E6B8A234458AE3D795

4) Once signed up you have one year time for completion.

more info: https://about.gitlab.com/blog/2021/04/20/everyone-can-get-certified/
Multiplayer online games
Tags: ios, gamedev, iogames, build
Published: 2021-04-22 03:59:19

Share to DEV forum members about the latest [io games](https://iogames.onl).
Game io is a type of online game with a stable network connection and available in web browsers.
Join the [build royale](https://iogames.onl/build-royale-io) featured games in io games to experience and conquer challenges.
How I use a Hash Instead of Case Statement in Ruby
Tags: ruby, beginners, refactorit, codenewbie
Published: 2021-04-22 03:53:34

# Case Statements are so 2020

#### Spice up 2021 with a Hash instead.

I wanted to share a technique I reach for in my Ruby toolkit when I find myself in a situation that calls for some sort of case statement.

Let's imagine our codebase has an item. Let's pretend that there are two types of items, each requiring a slightly different processing. We might be tempted to write:

```ruby
case item
when Fancy
  FancyProcessor.call(item)
when Simple
  SimpleProcessor.call(item)
end
```

There is nothing wrong with this code. I just happen to prefer a different approach. Instead I like to define a hash that allows me to turn my case statement into a lookup.

```ruby
PROCESSOR_MAP = {
  Fancy => FancyProcessor,
  Simple => SimpleProcessor
}

processor = PROCESSOR_MAP[item.class]
processor.call(item)
```

Now, perhaps we need some default behavior for items that are neither simple nor fancy. With a case statement, we just add a final else clause.

```ruby
case item
when Fancy
  FancyProcessor.call(item)
when Simple
  SimpleProcessor.call(item)
else
  DefaultProcessor.call(item)
end
```

We can do this with our Hash as well by adding a default value to our hash:

```ruby
# Normally new keys in a hash get a value of `nil`, but we can overwrite this
# by using Hash.new and passing in our preferred default value.
PROCESSOR_MAP = Hash.new(DefaultProcessor)
PROCESSOR_MAP.merge({
  Fancy => FancyProcessor,
  Simple => SimpleProcessor
})

# Now if item.class is neither `Fancy` nor `Simple`
# We'll get the default `DefaultProcessor` we assigned as our hash's default value.
processor = PROCESSOR_MAP[item.class]
processor.call(item)
```

I prefer the hash for two reasons. I think it expresses the idea a bit more succinctly. I also know that very soon we will invent a new type of item and processor. When that happens it feels like updating the code is more of a configuration issue than adding new business logic. Here's what I might do:

```ruby
CONFIG = { 
  Fancy => FancyProcessor,
  Simple => SimpleProcessor,
  NewShiny => NewShinyProcessor
}

PROCESSOR_MAP = Hash.new(DefaultProcessor).merge(CONFIG)

PROCESSOR_MAP.fetch(item.class).call(item)
```

This is a contrived example and the result does not look great. The big picture here is what is important: It is fun and exciting to swap a case statement for a hash in Ruby.
ແກ້ບັນຫາເປີດ Xcode ios folder ຂອງ project flutter ບໍ່ຂຶ້ນ
Published: 2021-04-22 03:35:20

ມີບາງເທື່ອເຮົາກໍ່ຈະພົບເຫັນຫາ ເປີດ folder ios ຂອງ project flutter ບໍ່ຂຶ້ນ ສາເຫດມາຈາກຫຼາຍຢ່າງ. ແຕ່ທີ່ຜູ້ຂຽນພົບຄື ກໍລະນີ້ທີ່ເຮົາ ປິດ project ຕອນກຳລັງ build ຫຼື ປິດ project ບໍ່ສົມບູນ. ເຮັດໃຫ້ໂຄງສ້າງ project ios ຜິດໄປຈາກເດີມ. ວິທີແກ້ກໍ່ງ່າໆ

1. ລົບ `Pods`, `.symlinks`, `Podfile`, `Podfile.lock`
2. ເຂົ້າໄປທີ່ `Runner.xcworkspace` ແລ້ວລົບ `xcuserdata` folder ອອກ
3. ຈາກ `terminal` run command `flutter clean`
4. ອອກຈາກ ios folder ແລ້ວ ran `flutter pub get` 
5. ເຂົ້າໄປ ios folder ອີກຄັ້ງ ແລະ ran `pod update` ຫຼື `pod install` 

ເປັນອັນຈົບພິທີຫຼັງຈາກນັ້ນກໍ່ລອງເປີດດ້ວຍ xcode ອີກຄັ້ງຖ້າບໍ່ມີຫຍັງຜິດພາດກໍ່ສາມາດເປີດຂຶ້ນໄດ້ແລ້ວ ແຕ່ຖ້າເປີດບໍ່ຂຶ້ນກໍ່ໂຕໃຜໂຕມັນ ຮະຮະຮຮະຮະ
Scientific Programming School
Tags: beginners, tutorial, programming, devops
Published: 2021-04-22 02:55:06

The ‘**Learn Scientific Programming**’ project in 2016 started as an eLearning blog to demonstrate the use of scientific programming languages in processing Big data. In the year 2020, we founded a next generation learning platform for creating and delivering interactive and adaptive courses on the advanced topics of Linux, Devops, HPC  Scientific programming languages and Data Sciences: **Scientific Programming School** https://scientificprogramming.io/
From where that configuration is coming from?
Tags: configuration, csharp, dotnet
Published: 2021-04-22 02:44:52

You can provide configuration from different places in .NET Core: [JSON file, INI file, environment variables, ...
](https://docs.microsoft.com/aspnet/core/fundamentals/configuration)

But how to debug what configuration is coming from where? [GetDebugView()](https://docs.microsoft.com/dotnet/api/Microsoft.Extensions.Configuration.ConfigurationRootExtensions.GetDebugView) to the rescue!

appsettings.json:

```json
{
    "myconfiguration": "foo"
}
```

appsettings.ini:

```
myconfiguration=bar
```


Environment variable:

```
$ export myconfiguration=qux
```

Program.cs

```cs
using Microsoft.Extensions.Configuration;
using System;
using System.IO;

var configuration = new ConfigurationBuilder() // Microsoft.Extensions.Configuration package
    .SetBasePath(Directory.GetCurrentDirectory()) // Microsoft.Extensions.Configuration.FileExtensions package
    .AddJsonFile("appsettings.json") // Microsoft.Extensions.Configuration.Json package
    .AddIniFile("appsettings.ini") // Microsoft.Extensions.Configuration.Ini package
    .AddEnvironmentVariables() // Microsoft.Extensions.Configuration.EnvironmentVariables package
    .Build();

// Displays the value from the environment values, or from the INI file, or from the JSON file.
// Follows the precedence of the configuration above.
Console.WriteLine(configuration["myconfiguration"]);

// Display all configurations key and values and the provider of such configuration.
Console.WriteLine(configuration.GetDebugView());
```
Protocolo HTTP e seus métodos
Published: 2021-04-22 02:34:46



 O HTTP (protocolo de transferência de hipertexto) é um protocolo usado para obtenção de recursos, como HTML, XML, JSON e etc. 
Nesse método o cliente e o servidor se comunicam por “trocas de mensagens” através de Requests e Responses:


Requests: o cliente faz a requisição para o servidor pelo seu navegador

Responses: o servidor obtém o que é requisitado e manda uma resposta para o cliente.

Em resumo, as requisições do usuário são enviadas para o servidor, que irá enviar uma resposta com o resultado.



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



#Métodos HTTP


Como foi dito antes, o protocolo HTTP é usado para obtenção de dados entre o cliente e o servidor, mas quais são os métodos dele? Aqui eu falo de alguns (ao menos, os mais utilizados):

GET: é o mais simples, através desse método fazemos a requisição de algo e que deve ser retornado em forma de dado, como foi dito anteriormente, esse tipo de dado pode ser HTML, XML, JSON ou outro.

POST: este método é utilizado quando se cria um recurso, como se enviasse alguma informação para o servidor.

DELETE: como o próprio nome diz, serve para deletar um recurso específico.

TRACE:  este método executa um teste loopback na requisição enviada, verificando se houve alguma adição feita por algum intermediário.

OPTIONS: Mostra na URL que foi especificada as opções de comunicação do HTTP.

PATCH: esse método é utilizado para aplicar modificações/atualizações em um recurso.

CONNECT:  Esse método estabelece um túnel para o servidor pelo recurso de destino.

PUT: Esse deve ser usado em situações específicas onde se quer enviar uma informação e apenas armazená-la, como um update.

Muito obrigado por ler até aqui!
Ludo CSS Grid Loodo!
Tags: ludo, css, ui, hobby
Published: 2021-04-22 02:33:28

Siempre me ha llamado la atención los juegovideos, aunque soy algo nulo en motores gráficos y solo me limito a lo que pueda realizar con canvas y svg animado, html, etc.. he estado trabajando en la ui de un juego ludo solo con css (scss), para experimentar con mis habilidades y como aplico algunos estilos de terceros en el proyecto.

Ahora que he logrado algo bien satisfactorio, mejore la grilla para que tenga las posiciones tal cual en el tablero y sea en teoría funcional, y no solo una grilla imitando un tablero.

He estado revisando react y vue, para agregar interactividad y hacerlo funcional.. además de que pueda de responder de forma dinámica a los cambios en los datos... después de un tiempo lo hice con angularjs.. si, el primer angular que solo es para front js.. basado en uso del dom como jquery etc. puede no ser una opción más moderna, pero me ha dado la libertad de crear estructuras de datos comprensibles y mantenibles para poder hacer las interacciones y reglas del juego.

Aún todo esto va en desarrollo y parte de la ui la deje en Codepen.

{% codepen https://codepen.io/vitoconavarrete/pen/NWdMGNm %}

Mi proyecto avanza y  poco a poco subo actualizaciones, acá puedes ver ciertos avances aun no funcionales [Versión online](https://loodo.netlify.app/)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ko6930tab3c5wqf0st3m.png)


Espero dejarlo funcional con las siguientes características: 
- juego funcional multiusuario local (ya funcional)
- modo jugador automático y robot (cpu) (pronto)
- usuarios reales, rooms e interacción realtime (websocket) (pronto y si técnicamente me dá)
- invitaciones a amigos por para jugar o visualizar un juego (pronto  y si técnicamente me dá)
- chat (pronto  y si técnicamente me dá)
- videochat (pronto y si técnicamente me dá)
- y otras ideas extras (pronto)

Todo esto es un pasatiempo, para probarme simplemente que puedo. si alguien tiene sugerencias de como implementar alguno de mis grandes items, los leo con entusiasmo.

Saludos!! ✌️
Create a CSS Star Rating Widget in 9 Steps
Tags: webdev, css, html
Published: 2021-04-22 02:29:22

Hi all,

For this week, I have a <a href="https://medium.com/codex/create-a-star-rating-widget-with-css-in-9-steps-fe323352dba4?source=friends_link&sk=ff9d30b6b4727494c092a9831f68a11e" target="_blank">quick tutorial</a> on how to create a Star Rating Widget with CSS in 9 easy steps. Enjoy!

 #CSS #coding #webdevelopment #frontenddev
PHP Laravel authentication method unknown to the client [caching_sha2_password]
Published: 2021-04-22 02:09:12

I am using laravel 5.8 and having MAMP server got this error resolved by adding DB_SOCKET=/Applications/MAMP/tmp/mysql/mysql.sock in .env file like below


`DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=8889
DB_DATABASE=dbname
DB_USERNAME=root
DB_PASSWORD=root
DB_SOCKET=/Applications/MAMP/tmp/mysql/mysql.sock`
Authorization Academy: Technical guides for building application authorization

Tags: authorization, webdev, security, accesscontrol
Published: 2021-04-22 01:43:33

I'm on the founding team at [Oso](https://www.osohq.com/), an open source library for authorization. Over time, we've gotten a lot of questions from developers on authorization basics – like how to model roles, where to add authorization checks, or how to integrate permissions in the UI.

It turns out that there's not much information available on these topics that's technical, concrete and user-friendly. So, we started writing a series of guides on these topics to capture everything we've learnt, heard, and experienced ourselves.

The series is called [Authorization Academy] (https://www.osohq.com/developers/authorization-academy). The first few chapters cover architecture and modeling roles. In the coming chapters we'll cover relationship-based access control, enforcement, and integrating permissions data into UIs. 

We have a lot of topics we'd like to write about, and they take a fair bit of time, but let us know if there's anything in particular you'd like to read about!

The guides cover authorization generically and are not specific to Oso, so they should be useful for anyone who is building authorization into their app or otherwise wants to learn about the area. Of course, if you'd like to learn more about Oso you can visit our [site](https://www.osohq.com) or come talk with us in [Slack](https://join-slack.osohq.com).

Looking forward to your feedback! And if you find the chapters useful sign up to get notified when the next ones are released.