teleren/devto huggingface dataset:
Beginner Node Help- take 2
Tags: node, pug, express, html
Published: 2018-10-15 18:40:43

---
title: Beginner Node Help- take 2
published: true
description: building my first Node application

tags:  Node, Pug, Express, HTML 
---
I am very new at HTML, NODE, PUG, etc. I'm trying to build a golf     
             score application.  I have created the first part that allows me to 
             CRUD the courses.  This part is working. 
             I have 2 tables,  courses and scores.  
             After displaying a list of courses, i select a course and load 6 
             blank HTML table records to allow entry of golfers and scores each of 
             the 18 holes.
             Now is where i'm confused and need some guidance.
             
             in my .pug file, how do i display an output field that displays a 
             running total of my score?
             
             On my submit button, i'm not getting to my POST, but i cannot figure 
             out why
               
             I want to be able to hit save on this screen and either Insert or 
             Update, depending on whether i have already saved.  Should that be 
             handled within a single POST?  It seems like i should, but i don't 
             know enough about Node to know

             I am processing my courses and scores within a single index.js file.  
             Should i be separating the courses/holes into separate .js files?

             Thats enough for now
             Thanks for any guidance you can provide

            app.get('/scores/keepscore', function(req, res) {
  res.render('scores/keepscore', { title: 'ScoreCard' ,form_action: `/scores/update`})
})
app.post('/scores/update', function(req, res) {
console.log('i got to the update')
let stmt = new db.dbstmt(dbconn)
console.log(req)
  var sql = 
      `INSERT INTO ${schema}.SCORECARD (COURSE,GOLFER, GDATE, HOLE1,HOLE2,HOLE3,HOLE4, HOLE5, HOLE6, HOLE7, HOLE8, HOLE9, HOLE10, HOLE11, HOLE12, HOLE13, HOLE14, HOLE15, HOLE16, HOLE17, HOLE18)
       VALUES ('${req.body.COURSE}','${req.body.GOLFER}',CURRENT_DATE, ${req.body.HOLER1}, ${req.body.HOLE2}, ${req.body.HOLE3},${req.body.HOLE4}, ${req.body.HOLE5}, ${req.body.HOLE6},
       ${req.body.HOLE7}, ${req.body.HOLE8}, ${req.body.HOLE9},${req.body.HOLE10}, ${req.body.HOLE11}, ${req.body.HOLE12},${req.body.HOLE13}, ${req.body.HOLE14}, ${req.body.HOLE15},
       ${req.body.HOLE16}, ${req.body.HOLE17}, ${req.body.HOLE18} ) with NC`
  stmt.exec(sql, function(result, err){
  console.log(err)
    res.redirect('/scores/keepscore')
     stmt.close()
  })
})
What are the main benefits of being a self-taught developer compared to being educated with a degree and mentoring?
Tags: discuss
Published: 2018-10-15 22:29:07

---
title: What are the main benefits of being a self-taught developer compared to being educated with a degree and mentoring?
published: true
tags: discuss
---

According to a Stack Overflow Developer Survey:

> Two out of three developers are self-taught - Many developers don’t have computer science degrees.

> Self-taught developers dominate technology: **69% of the developers who responded to the survey are at least partly self-taught**, and fewer than half hold a formal degree in computer science. In a trend spreading to other fields, many are choosing ways to learn that offer everything but a degree: online courses, bootcamps, on-the job training, and collaborating with peers.
First post
Tags: javascript, webdev, 100daysofcode
Published: 2018-10-15 22:00:09

---
title: First post
published: true
description: first published a post
tags: javascript, web development, #100daysofcode
---

 ![solved some css basic challenge on freecodecam](https://thepracticaldev.s3.amazonaws.com/i/nzri2cxiwq4bw422ag42.jpg)

#Day1 of #100DaysOfCode going through CSS basics on #freeCodeCamp 
I started #100DaysOfCode today! am so excited that I finally started.

will be learning a lot. so far I have solved some programming challenge on #freeCodeCamp

programming is not a new concept for me, I have created some websites with the help of video/online tutorials.
How to get through Chrome security error pages
Tags: tips, chrome
Published: 2018-10-16 11:07:37

---
title: How to get through Chrome security error pages
published: true
tags: Tips, Chrome
canonical_url: https://miguelpiedrafita.com/chrome-thisisunsafe/
cover_image: https://miguelpiedrafita.com/content/images/2018/10/Image-2018-10-14-at-2.44.43-PM-3.png
---
_Originally published on [my blog](https://miguelpiedrafita.com/chrome-thisisunsafe/)_

If you use Chrome, the chances are that you've seen the above image. It's shown, for example, when a page is in the [Google SafeBrowsing](https://safebrowsing.google.com/) blacklist or when its SSL certificate has expired. Normally, you can bypass this warning by clicking "_Advanced_" then "_Proceed to whatever.com (unsafe)_" but, if the website is using a special technology (called [HSTS](https://really-simple-ssl.com/knowledge-base/what-does-hsts-mean/)), the above method will not work, and you'll be presented with this message instead:

![How to get through Chrome security error pages](https://miguelpiedrafita.com/content/images/2018/10/Image-2018-10-14-at-2.57.16-PM.png)

I learned recently an easy trick to bypass this. Just type `thisisunsafe`, and Chrome will let you into the website.

While this protection is in place for a reason and it isn't a good idea to use this trick every time you get into a warning screen, this may help you access some sites you wouldn't be able otherwise (old sites whose certificate has expired or even your own site during manteniance).

_Liked this article? Consider [supporting me on Patreon](https://miguelpiedrafita.com/patreon). [Learn more](https://miguelpiedrafita.com/patreon)._
I haven't been assigned work all week. This is my first job/internship. Should I quit or stay longer?
Tags: anonymous, discuss, career
Published: 2018-10-15 21:59:47

---
title: I haven't been assigned work all week. This is my first job/internship. Should I quit or stay longer?
published: true
tags: anonymous, discuss, career
---

_This is an anonymous post sent in by a member who does not want their name disclosed. Please be thoughtful with your responses, as these are usually tough posts to write. Email sloan@dev.to if you'd like to leave an anonymous comment._

>I haven't been assigned work all week. It's hard to figure out who to talk to. I don't even know who my boss is.

>Should I quit, or stay longer to figure things out? I feel incredibly crappy sitting doing nothing.

>I'm a fairly skilled developer, but I've got no formal credentials. This is my first job/internship ever. Would quitting be bad? Would it reflect poorly?
Making the Alt Key Work in iTerm2
Tags: terminal, iterm2
Published: 2019-03-05 22:21:19

---
title: Making the Alt Key Work in iTerm2
published: true
tags: terminal, iterm2
canonical_url: https://www.clairecodes.com/blog/2018-10-15-making-the-alt-key-work-in-iterm2/
---

[iTerm2](https://www.iterm2.com/) is a replacement for the default Terminal application on MacOS. It has many more handy [features](https://www.iterm2.com/features.html) than Terminal, is free to download and is also [open source](https://github.com/gnachman/iTerm2) 🎉.

However, on initial install, you can’t use the Option or Alt key (the one that looks like this: <code>⌥</code>) as you would in other applications: it's not possible skip or jump over words by pressing Alt and the left or right keys. Instead you see sequences like `[D` or `[C`:

![Broken alt key displaying escape sequences](https://thepracticaldev.s3.amazonaws.com/i/zy18ortvk2ibppsyrldx.gif)

This can be changed by tweaking a couple of settings, which I'll explain below.

_Note:_ I refer to the ["Alt"](https://en.wikipedia.org/wiki/Alt_key) key throughout this post, as this is the text written on the key of my old 2013 MacBook Pro keyboard, but this is normally called the "Option" key in MacOS.

---

Open the "Preferences" menu: either find it in the "iTerm2" dropdown menu along the top of the screen or press the Command and comma keys. <kbd>⌘</kbd> + <kbd>,</kbd>

![iTerm2 general preferences menu](https://thepracticaldev.s3.amazonaws.com/i/ecm2tjv3notlkfbvpedd.png)

Choose the "Profiles" menu.

![iTerm2 profiles menu](https://thepracticaldev.s3.amazonaws.com/i/kd0la834fq3ea3gdqky3.png)

Select the "Keys" tab.

![iTerm2 keys tab](https://thepracticaldev.s3.amazonaws.com/i/g17oyzlcjpys4cs49s34.png)

Within the "Key Mappings" pane, find the mapping for the Alt and left keys, which will look like this: <code>⌥←</code>. Double click it.

![iTerm2 keys tab with Alt Mappings](https://thepracticaldev.s3.amazonaws.com/i/l39qmmtdew74qmuq7xzb.png)

Change the action from "Send Hex Code" to "Send Escape Sequence" (you might have to scroll a bit to find this).

In the "Esc +" field, type lowercase "b" and click "OK".

![iTerm2 Alt left mapping](https://thepracticaldev.s3.amazonaws.com/i/cmds3b1wxv8koorlm1g5.png)

Open the same context menu for Alt plus right <code>⌥→</code> and again change the action to "Send Escape Sequence".

This time, in the "Esc +" field, type lowercase "f". Click "OK".

![iTerm2 Alt right mapping](https://thepracticaldev.s3.amazonaws.com/i/yke5jeb6rfwwdv4lhev5.png)

Close the Preferences menu. The changes take effect immediately. When you press <kbd>⌥</kbd> + <kbd>→</kbd> or <kbd>←</kbd>, the cursor will jump over entire words as it does on other applications. You can now navigate the command line with more precision and speed.

![Working alt key moving between words](https://thepracticaldev.s3.amazonaws.com/i/jvp67tmm7likx0bwjq9n.gif)

## Bonus shortcuts

<kbd>Control</kbd> + <kbd>e</kbd> will move the cursor to the end of the line.

<kbd>Control</kbd> + <kbd>a</kbd> will move the cursor to the beginning of the line.
Generalist vs Specialist Developers: Theory and practice
Tags: discuss, javascript, frontend, backend
Published: 2018-10-15 21:06:52

---
title: Generalist vs Specialist Developers: Theory and practice
published: true
description: The new growing trend of companies looking for full stack developers
tags: discuss,javascript,frontend,backend
---

Like every other Senior developer out there, I am quite often approached by companies looking for Web Developers to join their teams. When the message and project look interesting, I sometimes engage in a first general discussion either by phone or if the company is located physically close, in person.

There were always vague or badly written job descriptions in our field; Back where I come from, Greece, traditional software companies were notorious for looking developer profiles who could do everything from Databases to backend, frontend, system administration, and in very "exotic" language combinations (PHP, Java, .NET - in one profile). Companies were trying to save money by hiring one person, a generalist, to do everything. That naturally led to chaos and produced throwaway code no one was able to maintain or support (especially when the one man army developer would decide to move to a new project)

During the past months, and partially because of the prevalence of JavaScript in both ends of the development spectrum, I've noticed a growing popularity for "Full Stack" profiles. I had discussions with companies looking for a "Frontend Developer" who is: 
1. an expert (!) in iOS (Objective-C, Swift) and Android (Java) development and has years of experience in Native (!) application development
2. familiar with Python Ruby or Go
3. naturally an expert in frontend Frameworks

Where I come from, that's definitely not a "Frontend Developer".

I've observed developers around my network with very solid mathematical problem-solving skills, who come from a pure backend background and have jumped in the JavaScript train. They can code Node.JS based applications and APIs with ease but even if they claim they're "full stack", they really neglect a lot of the skills and tools needed to master the Frontend part of the job.

To me, a (Senior) Frontend Developer sits somewhere between Product, UI, UX and backend, and by collecting feedback orchestrates the final product result. He is someone who's familiar with things like device and browser quirks, accessibility, SEO, and who ultimately has an eye for design, or possible UX issues all this while keeping it with the very fast paced frontend ecosystem and its' tools and libraries - which is a full time job on its own. 

Do you think Frontend Development is moving to a phase that implementation of web interfaces for the browser is going to be only secondary to things like Node.JS, mastery of docker and microservices, and mobile development?

What is your opinion on profiles that claim they can do everything, and would you work for a company that expects you to do everything?
Using Libman Providers to Coral Front End Libraries
Tags: dotnet, libman, core
Published: 2018-10-17 01:57:22

---
title: Using Libman Providers to Coral Front End Libraries
published: true
tags: dotnet,libman,core
canonical_url: 
---

The first package management system I learned to use was Bower.  It was great for the short love affair we had together, but it stopped being supported and I was weary of learning to use one of its replacements.  Fortunately, I haven’t had to with Libman.  

Libman’s (Library Manager) simple JSON approach to bringing front end dependencies has been the easiest for me quickly implement and it has been a great addition to Visual Studio.  I implemented it possibly too quickly, however, and **overlooked one powerful configuration setting:  provider.**

## Library Not On Libman!

That was my first sign of trouble, but what actually happened:  I didn’t specify the right **provider**.

The defaultProvider I specified was cdnjs, like the many examples out there, and though it has a lot of front end libraries, _cdnjs, of course, doesn’t have all libraries._

Here’s a simple example of how Libman successfully does use cdnjs to bring in jQuery:

```json
{
  "version": "1.0",
  "defaultProvider": "cdnjs",
  "libraries": [
    {
      "library": "jquery@3.3.1",
      "destination": "wwwroot/lib/jquery",
      "files": [
        "jquery.min.js"
      ]
    }
  ]
}
```

## Libman Provider Options

In addition to CDNJS, Libman supports two other providers.  Here is the complete list:

* cdnjs (default provider)
* filesystem (local files)
* unpkg (a CDN for everything on NPM) 

This works great and<strong> if a dependency didn't resolve, I added a provider line, changing it's provider:</strong>

```json
{
  "provider": "unpkg",
  "library": "bulma-checkradio",
  "destination": "wwwroot/lib/bulma",
  "files": []
}
```
## UNPKG Library Could Not Be Resolved

When using unpkg as a provider, though, I couldn't get any files to list in Intellisense.  I simply got no results.  I also got no versions on the library.

So, I did a bit of a hack and used the 3rd option for provider: filesystem.

## Using Local Files
I had 2 particular packages that would show on unpkg, but return the following errors:

The "bulma-checkradio" library could not be resolved by the "unpkg" provider
The "datatables-bulma" library could not be resolved by the "unpkg" provider
Restore operation completed with errors

So, I imported them via NPM:

```json
{
  "name": "myproject",
  "version": "1.0.0",
  "devDependencies": {
    "bulma-checkradio": "2.1.0",
    "datatables-bulma": "^1.0.1"
  },
  "-vs-binding": {
    "BeforeBuild": [
      "update"
    ]
  }
}
```

But I didn't want to add my _node_modules folder to the project, making NPM packages unable to be brought into Views.  So, I used Libman to copy the files from the _node_modules folder into my wwwroot/lib folder:

```json
{
  "provider": "filesystem",
  "library": "node_modules/bulma-checkradio/dist/css/",
  "destination": "wwwroot/lib/bulma/bulma-checkradio/css",
  "files": [
    "bulma-checkradio.min.css"
  ]
},
```

It works, just wishing this was a bit smoother.
Git commit aborts before I can create a commit message and I use “--wait”
Tags: help, visualstudiocode, git, gitcommit
Published: 2018-10-15 20:34:02

---
title: Git commit aborts before I can create a commit message and I use “--wait”
published: true
tags: help, visual studio code, git, git commit
---

I use Visual Studio Code on my Mac as my text editor and have it set up to open a new window to type my commit message, however when I type 'git commit' in the terminal, it instantaneously displays 'Aborting commit due to empty commit message.'

I have my git config set up as 'git config --global core.editor "code --wait"' and when I type 'git config --global -e' it shows '[core] editor = code --wait'. I've uninstalled and reinstalled git, I've went through the [VS Code as Git Editor setup guide][1], and have searched online for a solution for at least ten hours. My git and VS Code versions are up to date and my commits work when I type 'git commit -m "message here"' in the command line, but I still don't know why my VS Code editor option isn't working.

Any ideas here? Thank you!


  [1]: https://code.visualstudio.com/docs/editor/versioncontrol#_vs-code-as-git-editor
How Do You Keep Track of Awesome Resources?
Tags: hacktoberfest, awesomelists, opensource
Published: 2018-10-15 20:29:03

---
title: How Do You Keep Track of Awesome Resources?
published: true
description: Awesome ways of keeping and saving cool resources found on the web
tags: hacktoberfest, awesomelists, opensource
---

Often times, I find awesome resources on the web, most of it I can't really read or skimp through at that moment. So what comes to my mind is to either save it to Pocket or bookmark the link. 

In all honesty, I hardly ever go back to those links due to some unforeseen reasons I can't tell. So an idea came to me why not create a repo on GitHub and have it open source where you can save those links you find and have them in several categories. Cool thing is other people get to contribute to that list too which is a double win for me.

That led me to creating this project called [Awesome Learning Resources](https://github.com/lauragift21/awesome-learning-resources). I started off exactly 10 Months ago adding awesome resources i find on the web to this repo and up until now i have got over 200 resources on my list which i tend to check up now and then thanks to other contributors that contributes other resources to this repo too.

_**So why am i writing about this?**_

This is me basically saying all ideas counts as long as it helps you achieve a goal. This awesome list here is one that I can check out anytime to find cool resources at any time I even have a category called Sick Picks where I keep track of awesome things I find mindblowing on the web. The web is full of exciting things and I can't possibly digest all at a glance so one of the reasons I created this list is to act as a safe haven for all those great resources. 



{% github https://github.com/lauragift21/awesome-learning-resources %}

Please feel free to contribute resources you find that is awesome and can help other people learning about Web Development.
Approaching software design principles
Tags: principles, coding, development, learning
Published: 2018-10-15 20:18:36

---
title: Approaching software design principles
published: true
description: The other day a dear colleague asked me where I got my software modelling ideas from, and that lead me to think about how I worked on system design principles.
cover_image: https://thepracticaldev.s3.amazonaws.com/i/5n0w5mu6e3u6zw3dzz54.jpg
tags: #principles, #coding, #development, #learning
---

The other day a dear colleague asked me where I got my software modelling ideas from, and that led me to think about how I worked on system design principles. I learned a lot about my own process, and would like to share with you.

You see, I've always had an "always be learning" approach to software development, and the way I usually do it is that I try to impose myself some constraints in order to exercise some principle, and to force myself to learn thinking in different ways.

Otherwise I would always be tempted to go the way I’m more used to, and I think it would really slow down my learning curve.

I will share some examples of how that works for me, I’m pretty sure I didn’t invent it, but I hope you might find it useful.

##The "composition over inheritance" case

One example is the "favor composition over inheritance" principle. I was pretty happy with my abstract classes and inherited methods, so why would that be attractive? I wanted to find out, so I put in place a constraint not to use any kind of inheritance anymore, even in cases where I thought it could make sense.

After some very awkward times where I had to think a lot to model requisites with composition that I could easily model with inheritance, the result was pretty awesome: I learned a very different way of structuring my code and saw clearly all the benefits of favouring composition over inheritance.

Today I’m a lot faster at designing with that principle in mind, and actually I haven’t felt the need for inheritance in a while.

##The “immutability” principle

The same was true for immutable objects. After reading about it and playing with it for a while, I decided to focus on it, and since then all my objects “have” to be immutable. 

Since I got used to this principle, immutability comes very naturally to me, and I the benefits are so great I just don’t use setters at all anymore (except in DTOs for parsing libraries compatibility).

The code is far easier to debug and to implement new features, as I don’t have to keep in mind the code parts in which a object’s state changes... It just doesn’t!

The point being that it started as a constraint, and evolved into a new way for me of thinking and designing software.

##The "let's wrap it up and keep it short" momentum

This approach has helped me a lot in my journey as a developer, and has made work never boring.

What about you, how do you keep learning software development principles? Have you ever used such a constraints-based approach? Let us know in the comments!
Buildings from the 19th Century
Published: 2019-01-31 20:11:30

---
title: Buildings from the 19th Century
published: true
tags: 
canonical_url: https://zeitschlag.net/buildings-from-the-19th-century/
---

In my new job I'm dealing with a lot of legacy code and from time to time, I want to set it all on fire and burn it to the ground and nuke it and burn it again, just to completely rewite everything. And although I know, that exactly this would be wrong, introduce a lot of old/new bugs blablabla, I still have this wish sometimes.

When I was unemployed, I found a long thread on Hacker News about this topic: [Ask HN: Codebase at my work is a complete mess, what should I do?](https://news.ycombinator.com/item?id=17819771). When I first saw it nearly two months ago, I just left the browser tab open to read it sometime in the future.

I spend a lot of time commuting these days and so I'm quite grateful to have something interesting to read. Last week, I stumpled upon the HN-tab again and sometime in the future has turned out to be since last week. There are a lot of good advices, this one made me smile:

> You know what they say in [real estate] about 19th century buildings, which are certainly technically inferior to newly constructed houses? „At least these buildings have been standing for a century without collapsing“

Another one compares large codebases with very interesting puzzles.

What has helped me in the past when dealing with legacy code, was to ask myself and other people: "Why are things the way they are? How do they work?" instead of judging them in the first place. I still regularly fail to not judge things. Most of the time, I just didn't understand the code.

Maybe I should be more grateful to see buildings from the 19th century. Oh, and I totally suck at solving puzzles. But nevertheless, I like them. Sometimes.

_Disclaimer: This blogpost was originally published on my [tech blog](https://zeitschlag.net/buildings-from-the-19th-century/)._