teleren/devto huggingface dataset:
geoffkats
Tags: github
Published: 2020-09-15 21:25:13

[Instructions]: # (To submit to the GitHub Actions x DEV Hackathon, please fill out all sections.)


### My Workflow
[Note]: # (Make sure to include the name of your GitHub Action and share where it's being used!)


### Submission Category: 

[Note]: # (Maintainer Must-Haves, DIY Deployments, Interesting IoT, Phone Friendly, or Wacky Wildcards)


### Yaml File or Link to Code

[Note]: # (Our markdown editor supports pretty embeds. Try this syntax: `{% github link_to_your_repo %}` to share a GitHub repository)


### Additional Resources / Info

[Note:] # (Be sure to link to any open source projects that are using your workflow!)

[Note]: # (Be sure to include the DEV usernames of your collaborators, if any. )

[Reminder]: # (Submissions are due on September 12th (11:59 PM PDT) and winners will be announced on September 23!)
Logical operators || (OR) and && (AND) and how to use them to find the first truthy or falsey value in a chain of operands
Published: 2020-09-15 21:05:15

_Photo by Vasily Koloda from [unsplash](https://unsplash.com/photos/-x-Brii2QaM). It could be me walking through JS :)_ 

Much of the content is based from [this tutorial](https://javascript.info/logical-operators). It helps me put it in writing to remember!

#|| OR#

If any of its arguments is `true` then it returns `true`. Otherwise, it returns `false`. When combining 2 operands, there are 4 possible combinations:

```
alert( true || true );   // true
alert( false || true );  // true
alert( true || false );  // true
alert( false || false ); // false
```

If the operand is not a boolean, it is converted to a boolean (`truthy` or `falsey`), like:

```
if (1 || 0) { // works just like if( true || false )
  alert( 'truthy!' );
}
```

##|| OR to find the first truthy value##

You can use `|| OR` to find the first truthy value if you have several operands. From what I read, what follows is a feature from Javascript.

- It evaluates operands from left to right.
- It converts each of them to boolean, and returns the first one being `true`.
- If it reaches the end and it has not found any `true` (all were `false`), it returns the last operand. 

```
alert( 1 || 0 ); // 1 (1 is truthy)

alert( null || 1 ); // 1 (1 is the first truthy value)
alert( null || 0 || 1 ); // 1 (the first truthy value)

alert( undefined || null || 0 ); // 0 (all falsy, returns the last value)
```

You can use the `|| OR` to do `short-circuit evaluation`: all operands will be evaluated until the first `truthy` is found, and that value is returned without reaching the following ones. For instance:

```
true || alert("not printed");
false || alert("printed");
```

Will print the second message only because, in the first one, evaluation stops upon reaching the first operand, which is `true`. 

#&& AND#

`true` is returned if both operands are `true`. Otherwise, `false` is returned:

```
alert( true && true );   // true
alert( false && true );  // false
alert( true && false );  // false
alert( false && false ); // false
```

Like in `|| OR`, operands are evaluated as booleans:

```
if (1 && 0) { // evaluated as true && false
  alert( "won't work, because the result is falsy" );
}
```

##&& AND to find the first falsy value##

Same as with `|| OR`, multiple operands can be evaluated and this time `&&` helps you find the first falsy value:

- It evaluates from left to right.
- It converts each operand to boolean, and when it finds the first `false` it stops and returns its value.
- If it reaches the end of the operands and all of them are `truthy`, it returns the last one. 

```
// if the first operand is truthy,
// AND returns the second operand:
alert( 1 && 0 ); // 0
alert( 1 && 5 ); // 5

// if the first operand is falsy,
// AND returns it. The second operand is ignored
alert( null && 5 ); // null
alert( 0 && "no matter what" ); // 0
```

`&& AND` takes precedence over `|| OR`, so `a && b || c && d` is the same as if the `&&` were in parenthesis: `(a && b) || (c && d)`.
A Small, Simple Trick to Make Your Text Editable via HTML
Tags: todayilearned, html, codenewbie
Published: 2020-09-15 20:57:52

![Woah GIF](https://dev-to-uploads.s3.amazonaws.com/i/98lkxs432cwq02d4z358.gif)

If you've been following my recent tweets, you might have noticed that I am currently coding along with Wes Bos' [JavaScript30 challenge](https://javascript30.com/).

While a lot of the challenges served as a refresher for my JavaScript knowledge, there were times when I had to pause the tutorial and shouted internally, "Woah, why didn't I learn about this earlier?!"

I had that moment again when approaching the challenge of creating moveable text shadows.

As it turns out, there is an HTML global attribute called `contenteditable` that allows the user to edit targeted text on the browser.

According to the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable), `contenteditable` is an **enumerated** attribute (meaning it has a list of possible values, as opposed to a *boolean* value), where `true` or an empty string indicates that the text is editable, and `false` otherwise.

If the attribute is not given any value, the value is treated as an empty string, which makes the text editable, like so:

```html
<div>
  <h1 contenteditable>🔥WOAH!</h1>
</div>
```

And just like that, you can type any text you want on your browser.

No CSS, no JavaScript, and no need for an input field. Just a plain little HTML attribute. (For security-related information, feel free to check out [this Stack Overflow discussion](https://stackoverflow.com/questions/41623980/is-the-html5-property-contenteditable-secure).)

![Woah GIF](https://dev-to-uploads.s3.amazonaws.com/i/98lkxs432cwq02d4z358.gif)

<hr>

Have you used `contenteditable` at work or for your projects? Is there any other front-end magic that you wish you found out sooner? Please share your experience in the comments, I'd love to see some practical use cases! 🙌
"The Pragmatic Programmer" #1 📚
Tags: books, pragmaticprogrammer, code, learning
Published: 2020-09-15 20:51:18

As a developer, we have a lot of things to learn, which is pretty cool: programming languages, frameworks, database, front-end, back-end, agile methods, team work...
But reading technical books is also very important. During my internship, my colleagues recommended two books to me : *"Clean Code"* and *"The Pragmatic Programmer"*. I decided to begin with this last one and while I read it, I will note the passages that I find interesting. Obviously the whole book is, but with such a rich book, every reader will find elements that appeal to him more than others.

The authors, Andrew Hunt and Dave Thomas, wrote the first edition twenty years ago. The new one re-examines what it means to be an efficient programmer. Intended for junior as well as senior, *"The Pragmatic Programmer"* is essential for anyone involved in software development and it seems to have had a profound influence on many developers since its first publication.
___

## **"What makes a Pragmatic Programmer?"**
With the preface, it starts strong. The first two tips are obvious but clear:

**_1. Care about your craft_**
**_2. Think! about your work_**

There is also a sentence which is very important:
**_"Never run on auto-pilot"_**

We must constantly reflect on what we are doing. If we copy and paste code, we are on auto-pilot. We are relieved it can work but often, we really don't know why it works. If something is unclear, ask your collegues, search on the web and try to understand.

Another point is about individuality and teams. The authors compare software construction with cathedrals during the Middle Ages. All individual craftspeople, like developers, have interpreted the engineering requirments for those gigantic constructions. They put their individualities in something bigger. If techniques become archaic, even ours, "our craftsmanship will still be honored".

___

I continue to explore this book and I will give my impressions during my reading :eyeglasses::books::stars:
Manchester Codes - Software Engineer FastTrack
Tags: beginners, discuss
Published: 2020-09-15 20:41:20

# Should I sign up?

The Software Engineer FastTrack is described as a 24-week immersive part-time bootcamp. More about it here https://www.manchestercodes.com/

It's a kind of bootcamp that you can attend while still working fulltime, which I do - in a totally unrelated field.

I'm really tempted. I have a fair amount of amateur experience in various aspects of software development amassed over a few years. I love programming - always have done - and would love to give it a try professionally. The course pretty much ticks the boxes for me.

## So why the question at the top of the page?

I'm looking to completely change direction in my career. 

"So what?", I hear you say. "Loads of people have successfully done that!"

Thing is, I'm 54 years old. I will be 55 a few days after the course finishes next year.

So, my question to you ... the Dev Community ... is, will I be taken seriously? 

Is it possible for somebody of my age to make the switch?
Do you know anybody who has? 
How would you react to a junior developer who's old enough to be your dad?

In the brief time that I have been a part of this community I have learned that it is a supportive and welcoming one. If that weren't the case then I don't think I would even be contemplating this. But all things have their limits.

I'm really excited to press the enrol button! 

At the same time I'm shitting my pants!

What should I do?

Thanks
Launching a JAMstack Website With NEXT.JS + Vercel
Tags: webdev, javascript, nextjs, cms
Published: 2020-09-15 20:37:49

Vercel, one of our partners, makes it easy for JAMstack developers to build static websites in Agility CMS. In this article, we’ll recap one of our latest webinars and explain how Vercel and Next.js give extra agility to Agility CMS.

What's really amazing is that you can do this and launch your site for free with Agility CMS and Vercel!

Keep reading over at the [Agility CMS blog](https://agilitycms.com/resources/posts/jamstack-nextjs-vercel)
Teaching CS: Guiding students to grow at their own pace
Tags: vscode, showdev, tools, teaching
Published: 2020-09-15 20:37:42

We all have a shortage of time and we’re seeing that many CS educators are overloaded with too many students in each class, especially in introductory college and university courses. [According to one Stanford report](https://cs.stanford.edu/people/eroberts/CSCapacity.pdf), this has been the case for the last two tech bubbles. 

At a time when we’re all embracing asynchrony and educators are trying to scale efforts beyond personal capacity, we’re looking for ways to give students the support system they need. Students are struggling to be successful.

We’ve created a [VS Code extension called CodeTour](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour) that guides people through any codebase, step-by-step, to learn at their own pace and see each piece in context. 

Instead of explaining isolated concepts to students, we believe that guiding the student through the codebase will help them understand how the code works. For example, we are able to point out where the data exchange happens and what an example of abstraction would be in the code, without changing the code itself. 

![Taking a Codetour](https://dev-to-uploads.s3.amazonaws.com/i/82vdoeatz1l4aygu1yes.gif)
We believe that seeing the code in context is a faster and more natural way to grasp new concepts.


The codebase uses a guided tour style to walk the developer through using explanations. The teacher can create a tour to share an explanation of any piece of the codebase, called a tour. Each tour contains tour steps. The steps can be edited right within VS Code.

The tour steps can contain markdown or run shell commands to make setup easier.

![Shell commands in Codetour](https://dev-to-uploads.s3.amazonaws.com/i/ga26t6vbgeflkey8iv7r.gif)

Teachers can [export tours to apply to other codebases.](https://github.com/vsls-contrib/codetour#exporting-tours)

Students have a [choice of different tours in the codebase](https://github.com/vsls-contrib/codetour#tree-view) so that they can understand how each concept fits.

We would like to hear from you: what do you think of [CodeTour](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour)? If you are an educator, is this something that you think would help teach CS?
GitHub Action to turn your profile README into a guestbook
Tags: actionshackathon, github, opensource
Published: 2020-09-15 20:23:31

---
title: GitHub Action to turn your profile README into a guestbook
published: true
description: My submission to the GitHub Actions x DEV Hackathon!
tags: actionshackathon, github, opensource
---
I am happy to participate in the Actions Hackathon and to share my work with my fellow dev.to readers and the open source community. Hopefully, my little project inspires you to use it or to start hacking on your own actions.

### My Workflow
As an open source contributor chances are high that you want to get feedback from the community and especially the lovely people who use your code to solve their problems. You need a way for them to interact with you and enable them to share their thoughts and thankfulness about your projects. 

[readme-guestbook](https://github.com/muety/readme-guestbook/) turns your GitHub profile page into an interactive guestbook. People can post issues to your repo, which are then rendered to the Markdown of your README. 

Try it out!

**Submission Category:** Wacky Wildcards

{% github muety/readme-guestbook no-readme %}

### Additional Resources / Info

* My own [profile](https://github.com/muety) as an example of the action in action 🤓
Github Workflow GUI
Tags: actionshackathon
Published: 2020-09-15 19:58:43

### My Workflow

This submission is actually neither a workflow nor an action, but unless I've misread them the rules don't actually specifically require that.

Instead this is a "tool" to build workflows using existing actions in a GUI. While just a very early prototype for now it could potentially become a way for people who aren't as comfortable with YAML to getting start with Github Actions.

Apart from finding actions and adding steps you can connect them (both steps generally and their inputs and outputs), edit Bash and Python scripts, manually add input environment variables as well as detect `::set-output` in Bash and Python scripts.

### Submission Category: 

Wacky Wildcards

### Yaml File or Link to Code

{% github 02JanDal/gh-workflow-gui %}

### Additional Resources / Info

Some screenshots:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8umvbsxs1or4e2hb5hcl.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/p5k3xjtju3yg33eihj4i.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/txblkbdvqfy8vshuna9p.png)
Test redirects after login by roles with Laravel.
Tags: laravel, tdd, login
Published: 2020-09-15 19:40:02

---
title: Test redirects after login by roles with Laravel.
published: true
description: Make assertions to test redirects by role after login.
tags: Laravel, TDD, login
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/o4cg7w9ekjqkb99xcp51.png
---

Common scenario: you have different roles and you want to test that user roles redirect after login to different endpoints.

Here I add simple example using role as a user column, but you can add a relationship directly from Team model/User model (many to many relationship) and then add pivot model as Role or just use Jetstream.

You can add as many complexity as you need, but we are going to keep it simple, here the snippet:

```php
use RefreshDatabase;
/** @test */
public function test_app_admin_can_login_and_go_to_admin_dashboard()
{
    $user = factory(User::class)->create([
        'role' => 'admin'
    ]);
    session()->setPreviousUrl('/login');
    $response = $this->post('/login', [
        'email' => $user->email,
        'password' => 'password',
    ]);
    $response->assertLocation(route('admin.dashboard'));
}
```

Code explanation: 

- First create a user by factory.
- Then add a session to establish a the current url.
- Then make the response to login with data (the default password in factories is "password").
- finally assert the current location, after login with any route as you need, if its a named route better.

Note: The user factory sintax change in Laravel 8, just a little bit so take that in mind.


Thanks for reading.
My goal for mobile games as a game developer
Tags: mobilegame, gamedev, unitydeveloper
Published: 2020-09-15 19:23:09

Greetings Dev community, this is my first post on this platform so it is going to be like a small-itch introduction of myself and what I am aiming as a developer.

My name is Esther Felicies, I have a background as a Back-end developer using Laravel (php, html, javascript, etc) to do the projects I work on. 

I go by "Rehtse Studio" on my social platform to share what i am working on and my process in gaining knowledge on a particular subject

My real goal and aim is to be a Unity Game Developer but more aim at mobile game.

The truth is that I see the mobile as another handheld device that will allows a lot of user to experience nice story in games. 

The things is that, personally, I will like to bring the same experience i felt when i played game on my GameBoy Advance, psp, etc. I know mobile device has some limitation for everything being on screen but that one of my goal.

I may be thinking to much since i am more a game programmer meaning that i need to feel comfortable in dealing with assets, shatter, etc.

My channel on YouTube it is still new but will work on it little by little.

Will post something more concrete but this is my version of a small introduction.

If someone want to ask something, feel free to ask me anything related to game dev.

Lets keep coding.
;-; Xent future?
Published: 2020-09-15 19:22:42

yea, xent is no longer xent, it is now Xent Future! So, I'm bored with school, and I got absolutely nothing to do, so, I think about new projects I can start, and Xent comes to mind... why? 2 months, no updates! 2 months, no patches! 2 months, I-spent-a-month-thinking-of-ways-to-destroy-a-USB-drive updates! Ok, we get the point! now, why is this now "Xent Future"? Because I said so, and it will be updated on a bi-monthly basis ( tip: that is every **2** weeks! ), so, Now then, usually xent is kept kinda without a package manager and such, WELL let's GET RID OF THAT, after today, our lovely co-dev @17lwinn ( on Github ), will be working on a package manager for xent, FULL TIME, and this manager will be one of the best ever (it will also act a lot like pnpm, because yet again, I said so! ) this new manager will make xent 20x easier to use and provide boilerplates to start with! 


Please note that all packages should be developed in python, but for let's say "script headers", a new feature that mimics the include tag of c++, or the require function of javascript, to allow you to append some nice, beautiful code to the top of the xent file!


Ok, back to business now that I revealed plans of a package manager, We will be having over ***6*** new features that will ~~Plague our existance~~ improve the functionality of Xent altogether. this also includes the feature of ~~abandoning lua edition because plugins are broken~~ Script Headers *cough* definitely not an idea stolen from c/c++/js/java/PHP/almost-every-language-in-existence... because these are not plugins, these are headers, things that get ran right at that moment ( the whole file ), right where the script was called. 


*"so what other things did you add?"*. We removed all of the unnecessary files ( including the cli, sorry @17lwinn! it had to be done, just, make the package manager. it'll suit ya well! ) and, now we are left with the bare bones of 2.0 ( not 2.0.2, I reverted that ). But, that isn't all! We also removed a pesky feature... @hold! So, now then, no more of that darn if-then lag we get from that part of the code, but, we still have a language to make, and our age old enemy to defeat, *DEBUGGING*'



tl;dr Xent is now named Xent Future, and has new features, and is no longer crappy, and is still going after the age-old enemy, *DEBUGGING*
Deploy React Site Using GitHub Actions & AWS CDK
Tags: actionshackathon
Published: 2020-09-15 19:19:37


### My Workflow
This is a React template that uses a GitHub Actions Workflow to deploy static files to AWS in multiple development environments with a custom domain and HTTPS.  The GH Actions Workflow leverages AWS CDK to create resources/provision services necessary for deployment.

The workflow assumes a Release Flow-like branching strategy that allows for the following development workflow:

- automated testing for "feature/*" branch pushes
- automated testing/dev deployments on pushes and pull requests into master
- automated testing/stg deployments/artifact storage upon tag pushes
- manual workflow for prod deployments where tagged version is specified and deployed from artifact storage


### Submission Category: 

DIY Deployments


### Yaml File or Link to Code

{% github https://github.com/jviloria96744/react-aws-cdk-template %}
Let's build for Ruby and Rails developers - Part 9
Tags: ruby, rails, tutorial
Published: 2020-10-01 18:11:14

---
title: Let's build for Ruby and Rails developers - Part 9
published: true
date: 2020-09-15 19:08:00 UTC
tags: ruby, rails, tutorial
canonical_url: https://web-crunch.com/posts/lets-build-for-ruby-and-rails-developers-part-9
---

{% youtube aJuuIEn2xk0 %}

In part 9 of my Let's build for Ruby and Rails developers series I break ground on our new job form and leverage Vue.js to do so.

A big goal of the Vue.js component of the app is to streamline the interactive experience of creating a new job. I want customers to be able to enter details, preview their job, and pay for their listing all within one flow.

Doing a multi-step form in Ruby on Rails is a bit tough but it is possible. To lean on a little more interactive tech I think Vue.js will lend a great hand going forward. I'm not a Vue expert but I know my way around. The app will be a bit complex but not the worst thing I've ever had to build.

There core steps of the job form will be:  
1. Job Details - A customer enters the job and its criteria.  
2. Preview - Once the details are entered and validated a customer can then proceed to the next step to see a preview of what the job will resemble once published.  
3. Purchase - This step will incorporate Stripe, a lot of AJAX, and some Rails API specific constraints. We'll need to validate a customer's card, gracefully handle errors and update state will things are happening behind the scenes.

This app within the Rails app will be a doozie but I think worthwhile. Once this is complete we can begin then to focus on presenting jobs in a useful and informative way throughout the site.

#### The series so far

- [Part 1](https://dev.to/justalever/let-s-build-for-ruby-and-rails-developers-2g1)
- [Part 2](https://dev.to/justalever/let-s-build-for-ruby-and-rails-developers-part-2-3310)
- [Part 3](https://web-crunch.com/admin/posts/lets-build-for-ruby-and-rails-developers-part-3/)
- [Part 4](https://web-crunch.com/admin/posts/lets-build-for-ruby-and-rails-developers-part-4/)
- [Part 5](https://web-crunch.com/admin/posts/lets-build-for-ruby-and-rails-developers-part-5/)
- [Part 6](https://web-crunch.com/admin/posts/lets-build-for-ruby-and-rails-developers-part-6/)
- [Part 7](https://dev.to/justalever/let-s-build-for-ruby-and-rails-developers-part-7-47n0)
- [Part 8](https://dev.to/justalever/let-s-build-for-ruby-and-rails-developers-part-8-f1)
- Part 9 (You are here!)

- [View the entire collection](https://web-crunch.com/collections/lets-build-for-ruby-and-rails-developers)