teleren/devto huggingface dataset:
Remote Can Troll
Tags: opensource
Published: 2021-10-08 20:27:39

This was a big learning week again, what started out looking like a quick assignment ended up a bit of a slog as I worked through all the little things that went wrong. 

I started out by getting in touch with Kien to work on his [potato generator](https://github.com/kiennguyenchi/potato-generator) (great name). It quickly became apparent that this SSG was structured much differently than mine, with lots of different files and functions split up into smaller logical chunks. It took a while to wrap my head around what was going on but he walked me through it and I had something approaching functional last night. I submitted a draft pull request, spent way too long messing around with string parsing as per usual and got it working by the end of the night. I pushed my commit and made my pull request ready for review, and this morning found out it was broken in several ways. Go figure.

![remote](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wr8vawmcfyaji9ycmuu3.PNG)
 
 

In the meantime, Kien had [made a pull request of his own](https://github.com/gusmccallum/GAS-ssg/pull/20) which, less excitingly, had nothing wrong with it. I had to get git cli to add his as a remote branch, and getting that working took some doing but with his help I got it running and was ready to merge. What ensued was a whole lot of banging my head against a wall figuring out why the merge wouldn't work, but eventually triumph and a successful merge. Somehow I had changed the URL to my origin to his branch's URL,  but setting that back to the correct one solved my problems and the merge was complete. 

Back to potato generator, I kept chipping away at it and had it almost ready to go this afternoon when I found I had glossed over the logic for supporting multiple languages in HTML. I didn't realize why he was iterating over the CLI arguments when in my SSG they were always in the same place relative to one another, so I did away with all those loops yesterday only to have to restore them today. After several tests I pushed the changes which [he then merged as well](https://github.com/kiennguyenchi/potato-generator/pull/12). 

Overall this was a cool experience, using remotes seems very useful and the concept of upstream/origin branches is making sense to me after this week's efforts. I'm glad I got cli git set up for future labs, and hope my next incursion with it goes smoother.
Laravel 8 User Roles and Permissions Tutorial using Laratrust Package
Tags: laravel, laratrust, role, permission
Published: 2021-10-08 19:51:07

Today our leading topic is laravel 8 roles and permissions tutorial. In this article, we will implement a laravel 8 spatie user roles and permissions tutorial. i explained simply step by step laravel 8 spatie/laravel-permission. step by step explain laravel 8 acl tutorial.

we are using spatie github package for roles and permissions in laravel 8 application. just follow bellow step to create acl in laravel 8.

Spatie role permission composer package provide way to create acl in laravel 8. they provide how to assign role to user, how to assign permission to user and how to assign permission assign to roles. i will write step by step creating roles and permissions in laravel 8 application.

Roles and Permissions through you can create several types of users with different role and permission, i mean some user have only see listing of items module, some user can also edit items modules, for delete and etc.
In this examples i created three modules as listed bellow:

https://www.codecheef.org/article/laravel-8-user-roles-and-permissions-tutorial-step-by-step
Do You Miss Strongly-Typed World When Coding in Python? [RE#8]
Tags: article, python, productivity
Published: 2021-10-08 19:43:46

---
title: Do You Miss Strongly-Typed World When Coding in Python? [RE#8]
published: true
date: 2021-10-08 19:30:00 UTC
tags: article, python, productivity, 
canonical_url: https://babakks.github.io/article/2021/10/08/re-008-do-you-miss-strongly-typed-world-when-coding-in-python.html
series: Regular Encounters
---

When it comes to static type checking, those who code in strongly-typed languages are likely to take the favors of the compiler for granted. They just presume it’s kind of a well-respected right for them to feel safe regarding type compatibility. But in the realm of weakly-typed languages, which are exceedingly on demand these days, things are different.

Recent years I’ve been working for companies who had picked JavaScript and Python as their language of development. As you may have guessed, facing type mismatch exceptions at **“runtime”** soon made me mad enough to begin looking for a solution. Only people who’ve experienced this, can feel that pain.

JavaScript people are lucky to have the well-known TypeScript at hand. For Python developers a good solution is `mypy` which is maintained by the official Python community: [`python/mypy`](https://github.com/python/mypy). You can simply install it via:

```
pip install mypy
```

Just run it in your Python project’s root directory to see the devils under the ground:

```
mypy .
```

Of course, to make the most out of it, you have to embellish your code with type annotations as exhaustively as possible. Type annotations (and the `typing` library) in Python were introduced in version 3.5. With `mypy`, configuration is a no brainer. Just look at this example (file `.mypy.ini` at root):

```
[mypy]
exclude = venv|env|.git| __pycache__ |a.*?regex.*?pattern

[mypy-setuptools.*]
ignore_missing_imports = True

[mypy-dateutil.*]
ignore_missing_imports = True
```

Beware of that many libraries are still not utilizing type annotations. That may cause `mypy` to raise errors or warnings. As you can see in the example configuration above, you can just disable type checking for them.

* * *

**_About Regular Encounters_**  
_I’ve decided to record my daily encounters with professional issues on a somewhat regular basis. Not all of them are equally important/unique/intricate, but are indeed practical, real, and of course,_ **_textually minimal._**
Show me your portfolio
Tags: portfolio, webdev, javascript, showdev
Published: 2021-10-08 19:08:35

I have read this title on Dev.to so many times and a few months ago I understood why. 

### The problem
I was looking for inspiration to create my own website but the most famous articles on google always show the same 20/30 super cool portfolios... 
I found some amazing platforms like awwwards etc, but the problem is that most of the sites listed are made thanks to very good designers, they are not exactly sites that a single developer is able to do alone (not technically, but from an artistic point of view). 

### The solution
So I put my portfolio development aside and I decided to create a platform where developers can share their portfolio. There will be no webagency sites, designers, no teams etc, only single developers portfolios.
**The website is called [devportfolios.net](https://devportfolios.net/)**

There are currently only a few sites uploaded but you can add yours for free and without registration. 
If you like the idea feel free to add your site :)
So, what do you think? any suggestions to improve the site?

P.S. [devportfolios.net](https://devportfolios.net/) does not use cookies or analytics, there are no ads and the code is public on github. It's just a side project.
A crash course into CI/CD services
Tags: data, cloudskills, tutorial, devops
Published: 2021-10-08 18:45:12

Let's talk about serverless CI/CD services provided by the Cloud Providers - we'll review the options and look at how to configure them.

{% youtube Z_dXhrpSRZw %}

Cloud Collective is a meetup for technologists interested in the Cloud Native approach towards developing and deploying web & mobile applications, streaming analytics, ETL pipelines, microservices, containers, functions, and applying Infrastructure as Code principles for automating infrastructure on AWS, Azure, and Google Cloud.

This CI/CD crash course will help you understand exactly what managed CI/CD services from AWS, Azure, GCP, and GitHub are, how to configure them, and also the pros and cons of each vs. a self-hosted one.

If you enjoyed this talk, join our cloud collective group here ► https://www.meetup.com/cloud-collective/ and participate in our next meetup!
Supporting JSON config file
Tags: opensource, json
Published: 2021-10-08 18:29:49

This week, I worked on [Leyang Yu](https://github.com/lyu4321) Static Site Generator project called [jellybean](https://github.com/lyu4321/jellybean). I added a new [issue](https://github.com/lyu4321/jellybean/issues/15) on her repo to let her know that I wanted to add a new `--config` option to support a JSON config file. Luckily she agreed, so I got started right away.

After forking her repo and cloning the fork to my local machine, I create and switched to a new local branch called issue-15 by doing:
`git checkout -b issue-15`.

On this branch I made the necessary changes to allow the program to work with a JSON config file. To do that I used the node module [jsonfile](https://www.npmjs.com/package/jsonfile) to read the content of the JSON file and save it into `argv`:

```js
argv = jsonfile.readFileSync(argv.config, (err) => {
    if (err) console.error(err);
})
```

Of course I also had to add the option for `--config` and `-c` to [yargs](https://www.npmjs.com/package/yargs) (The node module used to parse arguments from the command line):

```js
.option('config', {
    alias: 'c',
    describe: 'Path to a JSON config file',
    type: 'string'
})
```

Once I had an initial version, I wanted to know what Leyang thought of it, so I pushed the branch to my copy of the jellybean repo (`git push origin issue-15`) and opened a draft Pull Request. This is a great way to show the work in progress to the project maintainer.

I received some feedback from her and made the requested changes. While doing that, I noticed other bugs that escaped me at the beginning (For example I was not checking if `path.extname(input) == '.json'`).

We had one more round of back and forth and finally my [Pull Request](https://github.com/lyu4321/jellybean/pull/16) was merged into the repo. This made me realize how important it is to get a second pair of eyes looking at the my code. I also learned that I need to do a lot more testing before being ready to push my code for a PR.
Lessons From 3 Months As A Dev Intern
Tags: inclusion, firstyearincode, internlife, lessonsfromanintern
Published: 2021-10-08 18:43:29

During my coding boot camp, I once asked alumni what the best thing they took away from the program was. I was expecting they'd mention something from the tech stack they used. Instead, they all said the same thing: "Learning how to learn quickly." 

Currently, I'm learning C#, ASP.NET, Entity Framework, and LINQ. I feel the same way I did when I was at square 1 in my boot camp. There are times I feel tempted to push myself harder because I feel uncertain about my skills.

###To gain perspective, here are some things to keep in mind if you're just starting out in the field:
1. **As long as you're learning, you're not doing poorly**--ESPECIALLY if you've only been doing this for less than 2 years.
2. **If you're learning a new language and framework on the job, a good manager and team likely understands.** Mine definitely do--and for that I'm so grateful.
3. **You can't skip steps. You've got to love learning.** If you need to learn something--find a way. You can learn with accountability by studying with peers or by taking courses at a community college. You can learn independently through online courses such as Codecademy, YouTube, or FreeCodeCamp. You can also ask coworkers about tutorials they've used. There's a lot to learn, from the higher level to the lower level of programming.
4. **It's important to find and appreciate others who believe in you.** Whether it's a career mentor or a tech mentor, having someone to talk through some of your concerns as a professional developer will help in building confidence. Mentors and colleagues help reduce unnecessary stress in times you might be struggling to believe in yourself.
5. **"Asking a lot of questions at work doesn't mean you're a burden. In fact, it helps you get up to speed so you can soon relieve your team of some of their work."** This was advice from my mentor when I told her I was worried about wasting the time of more senior engineers with my questions. Additionally, learning from the company's code is equally, if not more, important than learning on the side. You can go down tutorials forever and still not learn if you don't apply it. There's so much to learning on the job than just programming itself, especially when it comes to company policies and team conventions.

I am grateful I have the best case scenario--my managers, team, and company is great; my mentors are amazing; and I have colleagues from underrepresented groups I can talk to for support. But even so, there are days I really wish I had more of a stronger background in CS. At this point, I am open to all possibilities. In any case, it's important to continue believing in yourself and growing.
Get Paid Writing
Tags: writing, webdev, motivation, programming
Published: 2021-10-08 18:23:34

Here are a few sites to assist you locate sites that pay technical authors if you're a geek who enjoys writing technical stuff.
* [Community Writer Programs](https://github.com/malgamves/CommunityWriterPrograms)
* [Who Pays Writers ](https://whopayswriters.com)
* [Who Pays Technical Writers ](https://whopaystechnicalwriters.com/)
How to create responsive navbar {twitter clone} with HTML CSS JavaScript
Tags: css, webdev, tutorial, beginners
Published: 2021-10-08 18:14:16

{% youtube 0MDBVR93g7E %}

How to create responsive navbar twitter clone with HTML CSS JavaScript

Complete responsive twitter sidebar 2021

In this video I will show you how to clone complete responsive twitter sidebar step by step.

📥 | Ion-icon Link
  →  https://ionic.io/ionicons/usage

❤️ | Interested in seeing more videos? SUBSCRIBE NOW
  →  https://bit.ly/3m4UgF5

👤 | Like - Follow & Subscribe Me
  →  Twitter : https://twitter.com/codewithsadee
  →  Github : https://github.com/codewithsadee
  →  YouTube : https://bit.ly/3m4UgF5

---

[![Buy Me A Coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9kn6vwn4mulhsx6o69is.png)](https://www.buymeacoffee.com/codewithsadee)
👏 New EuroPython Fellows
Tags: europython, fellows, community
Published: 2021-10-08 18:00:07

The board has selected two new [EuroPython Fellows](https://www.europython-society.org/europython-society-fellow-grant/#europython-fellows), after receiving nominations from the membership:

* Laura Creighton (2021)
* [Oier Etxaniz Beneitez](https://www.europython-society.org/farewell-to-oier-echaniz-beneitez/) (2021, posthumously)

## EuroPython Fellows
EuroPython Fellows have contributed significantly towards our mission, the EuroPython conference and the Society as an organization. They are eligible for a lifetime free attendance of the EuroPython conference and will be listed on our [EuroPython Society Fellow Grant page](https://www.europython-society.org/europython-society-fellow-grant/) in recognition of their work.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/huul7ge077l6ltq9lntr.png)

**Laura** has been very active in the early days of the conference, especially in running the EuroPython editions in Gothenburg and helping with the selection process for later editions.

**Oier** was one of the team members who ran the conference in Bilbao. Sadly, he passed away last year, so we can only recognize him for his efforts posthumously. Still, we believe that he would have liked his new status. 

The EuroPython Society Board would like to congratulate and thank Laura and Oier for their tireless work towards our goals.

Many thanks,
EuroPython Society
https://www.europython-society.org/

---

Originally posted on https://www.europython-society.org/new-europython-society-fellows/
do you know the difference between "live node list" vs "static node list" ?
Tags: javascript, beginners, programming, codenewbie
Published: 2021-10-08 17:51:41

well, when you fetching a list of elements from the Dom you have two methods:

- querySelectorAll()

- getElementsByTagName()

both methods will return (Simi-array of node elements), but not same array; 

to take closer look lets add new element to this list and see what happens:

when you use querySelector method will return (NodeList object) a NO-LIVE-LIST it's got a snapshot from DOM (HTML ELEMENTS) and not update that array so when array changes when you updated from javaScript file using append() or appendChild().

with the other methodgetElementsByTagName() will return a(HTML collection ) a LIVE-LIST got an updated with elements you added.

one more tip: 

still we using the querySelector methods for flexibility  we have when we select elements, and maybe can be better for performance when you select elements only on html and remember you still have that live references to the DOM so you can easy change the value of this reference(pointer) easy by textContent() method.
Golang 101: Harita (Map)
Tags: go, map
Published: 2021-10-08 17:40:21

Haritalar (`map`) diziden (*array*) ve kesitten (*slice*) farklı olarak `degisken["anahtar"] = değer` şeklinde anahtar (`key`) verisinin türünü de belirlemenize imkan tanır. Böylelikle `string` bir anahtar tanımlayabilirsiniz. Hatırlarsanız dizi ve kesitte `degisken[indis]=deger` şeklinde anahtar yerine indis (*index*) numerik ve sıralı olarak oluşturuluyordu.
```golang
package main

import "fmt"

func main() {

	// Boş Map Tanımlama
	h := make(map[string]int)

	// Değer Atama
	h["k1"] = 7
	h["k2"] = 13
	fmt.Println("Harita:", h)

	x := h["k1"]
	fmt.Println("x: ", x)

	fmt.Println("Boyut:", len(h))

	// Öğeyi Silme
	delete(h, "k2")
	fmt.Println("Yeni Harita:", h)
	fmt.Println("Yeni Boyut:", len(h))

	_, prs := h["k2"]
	fmt.Println("Mevcut mu:", prs)

	// Tanımlama ve Değer Atama
	n := map[string]int{"go": 1, "lang": 2}
	fmt.Println("Harita2:", n)
}
```
```
Harita: map[k1:7 k2:13]
x:  7
Boyut: 2
Yeni Harita: map[k1:7]
Yeni Boyut: 1
Mevcut mu: false
Harita2: map[go:1 lang:2]
```
[çalıştır!](https://go.dev/play/p/EugeNnit24M)

## Boş Map Tanımlama
```golang
	h := make(map[string]int)
```
Boş bir `map` tanımlamak için `slice`'da olduğu gibi `make()` fonksiyonu kullanılır. Örnekte `anahtar` (`key`) değeri `string`, değer (`value`) türü ise `integer`'dır.

## Değer Atama
```golang
	h["k1"] = 7
	h["k2"] = 13
	fmt.Println("Harita:", h)

	x := h["k1"]
	fmt.Println("x: ", x)

	fmt.Println("Boyut:", len(h))
```
Oluşturulan değişkenin `anahtar` değerlerinin (*k1*, *k2*) ve değerlerinin (*7*, *13*) atanması görülmektedir. Akabinde ise `x` değişkenine `k1` anahtarına sahip değişkenin değerini atamakta ve son olarak da `len` ile mevcut eleman sayısı ekrana yazdırılmaktadır.

## Öğeyi Silme
```golang
	delete(h, "k2")
	fmt.Println("Yeni Harita:", h)
	fmt.Println("Yeni Boyut:", len(h))

	_, prs := h["k2"]
	fmt.Println("Mevcut mu:", prs)
```
Map'ten `delete()` fonksiyonu ile belirtilen anahtarı ve değerini silebilirsiniz. Silinen anahtarı kontrol için de `_, prs := h["k2"]` ile değerini (örnekte: 0) ve varlık durumu `bool` olarak alabilirsiniz. Böylelikle değerin varlığını kontrol edebilirsiniz. Örnekte silinen anahtarın değeri olmadığından `0` alırken varlık durumu `false` olarak döner.

Golang'de `_` (*alt çizgi*) özel bir boş tanımlayıcıdır. Herhangi bir işlemde kullanılmayacak değerler bu değişkene atanır.

## Tanımlama ve Değer Atama
```golang
	n := map[string]int{"go": 1, "lang": 2}
```
Map tanımlamlarken değer de yukarıdaki örnekte olduğu gibi atanabilir.
Don't update Xcode via the App Store. Don't!
Tags: xcode, swift, ios, swiftui
Published: 2021-10-08 16:53:31

If you have a MacBook with 128 gigabytes of hard disk, I would strongly suggest you do not update or download Xcode via the App Store. It has been my experience for the last three or so years I’ve been using Xcode that it takes most of the day to update or install it. Like it literally took me the whole of yesterday to update to Xcode 13. 

After downloading over 20 gigabytes (for a download that should be just above 12 gigs), the update failed. Which means I didn’t code as much as I usually do yesterday. I then decided to download the .xip file from the link at xcodereleases.com. Had I known, that is what I would have done from the beginning.

If you decide to download the .xip file, you’ll need to uninstall Xcode from your computer before installing the download, or you will have 2 versions of Xcode on your computer and that would take up a lot of precious hard disk space.

After downloading the .xip file from xcodereleases.com, you will need to drag the file into the Applications folder on your Mac. Double click on the file to install it. It would first verify the .xip file and then begin expanding the file, then it would install Xcode. 

You can then delete the .xip file or move it someplace else if you would need it in the future. (Leaving it in the applications folder will only take up more precious hard disk space).

So there you have it. This is how I will be updating or installing Xcode going forward.
Happy coding!

PS: even if you have a Mac with 256 gb or more of storage I think this is how you should install or update Xcode.
PRs, Merges and Json
Tags: opensource, osd600
Published: 2021-10-08 17:30:44

Hey everyone! So this week in my OSD600 class we had to add a config feature to a fellow student's static site generator.

### Feature

The config feature enables a user to pass a -c or --config flag with the path to a json file that contains the equivalent relevant info that could be passed via the command line. E.g
```
# Option 1: use command line arguments:
ssg --input ./site --output ./build --stylesheet https://cdn.jsdelivr.net/npm/water.css@2/out/water.css --lang fr

# Option 2: use a config file
ssg --config ./ssg-config.json
```
the ssg-config.json contains 
```json
{
  "input": "./site",
  "output": "./build",
  "stylesheet": "https://cdn.jsdelivr.net/npm/water.css@2/out/water.css",
  "lang": "fr"
}
```

### Issue and PR

The first thing I did was to create an [issue](https://github.com/nguyenhung15913/OSD600-SSG/issues/15) after forking [OSD600-SSG](https://github.com/nguyenhung15913/OSD600-SSG)

The matching PR can be found [here](https://github.com/nguyenhung15913/OSD600-SSG/pull/17)

### Thoughts

This was quite an easy addition. I decoupled the main logic into a proccessInput function then all I had to do was parse the json file if that was a given flag and call proccessInput. All changes can be found in the PR

```javascript
f (command.c || command.config) {
  if (command.i || command.input)
    return console.log("Cannot provide both a config and input file");

  if (command._.length <= 0) {
    return console.log(
      "Please enter a config file name e.g: --config config.json"
    );
  }

  if (!yargs.argv._[0].endsWith(".json"))
    return console.log("Config file must be a json file");

  if (!fs.existsSync(yargs.argv._[0]))
    return console.log("Config file does not exist");

  const configFile = fs.readFileSync(yargs.argv._[0]);
  const config = JSON.parse(configFile);

  inputFileorDir = config.input;
  command.s = config.stylesheet;
  command.l = config.lang;

  processInput();
}
```