teleren/devto huggingface dataset:
Git,Github and the command line are not that hard! Beginners learning resource.
Tags: git, github, codenewbie
Published: 2019-12-03 21:27:42

You might find the command line intimidating. It's actually not that bad(only about 10 commands to remember). While you will probably be able to work well without using the command line, it would be extremely beneficial to you if you learnt it.

There are many tutorials out there on this topic but it can still be hard to understand the concepts.Here is what worked for me.

I recently benefited from watching one of brad traversy's tutorial on git, github and the command line and it helped me come from zero to a comfortable level in about 30 minutes.

I greatly benefited from this tutorial and thought i could share the link to this tutorial in my first blog post 

The link is https://youtu.be/SWYqp7iY_Tc

I hope that this will be useful to those of you trying to learn git,github and the command line.

After watching the tutorial you can look for a cheat sheet to use(it will help you remember the commands). There are so many out there, a simple google search should provide them for you and then download a pdf version of the one that works for you.

Thanks. Remember to have Fun.🤓🤪
OpenWISP
Tags: opensource, openwisp
Published: 2019-12-03 16:15:34

At first, It makes no sense what I write about OpenWISP. I first time hearing the name of the organization. But after reading a for a time. I am able to write this.

__What is OpenWISP?__

	OpenWISP is an open-source organization that allows creating low-cost networks. The main goal of this project is to give users around the world easy to use tools so that they can build their own local area networks/internet infrastructure with the hope of bridging geographically distant and low-income areas to the rest of the world.

__History:__

	OpenWISP started when Rome province decides to provide free access to roughly 120 cities. This gave birth to innovative architecture named OpenWISP. This architecture continues to grow and today we have OpenWISP2. Since then many big organizations are using OpeWISP for their wifi networks.
(Source: http://openwisp.org/history.html)

__Goals and Values:__
 	The goal of OpenWISP is to provide open-source tools to create public networks.
_Communication through electronic means is a human right._ OpenWISP aims to extend the internet to the people of the world which are living without it.
_Net Neutrality._ OpenWISP encourages open internet therefore the first network they create no one has special privileges.

__OpenSource:__
	OpenWISP is an opensource organization so it encourages developers to contribute to the project. It has gitter channel, google group where you can ask questions. The community support is great. Since OpenWISP is open-source, you can write your custom extensions and modify OpenWISP2’s code to your liking. It’s fully customizable, and many people (including me!) contribute to it by adding features, fixing bugs, etc. I’m joining OpenWISP for Google Code-In.
How would you make a fullstack app without a frontend framework?
Tags: webdev, node, javascript, vanilla
Published: 2019-12-03 21:24:31

Hi guys,

I've got some questions that I really hope someone here might be able to help me with.

I'm trying to create a streamlined workflow for building a full-stack node app. I'd like to bundle my front-end assets with webpack, and then have Express serve those assets with a template engine (Pug or EJS). It would be great to also put those statics assets in a folder that can then be served by Nginx. My issue is that I often see index.html files in the frontend folder being bundled by webpack along with the static files. I'm assuming this is because it's for static sites, rather than web applications...but I might be wrong.

So my questions are these:

What is the right way to structure a fullstack app without a front-end framework, with webpack, where you use a template engine to render your html?

Should my views folder be inside my server folder? Or should it be inside the frontend folder?

OR

Am I completely missing the point? 

I've being doing web dev for quite a long time but I've never got my head round this, so I'd really appreciate any help.

Thanks
Seriously, Jenkins?
Tags: git, jenkins, obtuse, pedantic
Published: 2019-12-03 21:43:46

---
title: Seriously, Jenkins?
published: true
date: 2019-12-03 20:54:00 UTC
tags: git,jenkins,obtuse,pedantic
canonical_url: https://thjones2.blogspot.com/2019/12/seriously-jenkins.html
---

Have I used that title before? I feel like I ask that question a lot when writing pipelines for Jenkins.  
  
Today's bit of credulity-testing had to do with using the pipeline DSL's <tt>git</tt> directive. Prior to today, I'd been setting up Jenkins jobs to only deal with branches. Since the project I'm working on has a bit more complexity in its code-flow, I figured I'd try using release-tags instead of branching.  
  
It, uh, didn't go well. Normally, when I'm using a branch-based approach, I'm able to get away with DSL that looks something like:

```
pipeline {

    agent any

    parameters {
        string(
            name: 'GitCred',
            description: 'Jenkins-stored Git credential with which to execute git commands'
        )
        string(
            name: 'GitProjUrl',
            description: 'SSH URL from which to download the git project contents'
        )
        string(
            name: 'GitProjBranch',
            description: 'Project-branch to use from the git project'
        )
    }

    stages {
        stage ('Prep Work Environment') {
            steps {
                deleteDir()
                git branch: "${GitProjBranch}",
                    credentialsId: "${GitCred}",
                    url: "${GitProjUrl}"

[...elided...]
```

  
Unfortunately, when you want to use _tags_ the invocation is a bit more pedantic (and the documentation is maddenly obtuse in trying to find this juju):  
  

```
[...elided...]
    stages {
        stage ('prep Work Environment') {
            steps {
                deleteDir()
                checkout scm: [
                    $class: 'GitSCM',
                    userRemoteConfigs: [
                        [
                            url: "${GitProjUrl}",
                            credentialsId: "${GitCred}"
                        ]
                    ],
                    branches: [
                        [
                            name: "${GitProjBranch}"
                        ]
                    ]
                ],
                poll: false
[...elided...]
```

  
It was where, having switched to this form and my job started working that I loudly uttered, "seriously, Jenkins??". My cube-mates love me.  
  
On the plus side, while my original invocation works only for branches, the more-pedantic invocation works for both branches and tags.
OpenNMS Meridian 2018.1.14 (Earthquate) Released
Tags: releases
Published: 2019-12-09 18:28:10

---
title: OpenNMS Meridian 2018.1.14 (Earthquate) Released
published: true
date: 2019-12-03 20:45:34 UTC
tags: Releases
canonical_url: https://opennms.discourse.group/t/opennms-meridian-2018-1-14-earthquate-released/898
cover_image: https://i.imgur.com/74fmzvG.png
---

Release 2018.1.14 is a small update to 2018.1.13 that fixes a few bugs including a fix to syslog date parsing, Drools fixes, and a few other changes.

The codename for 2018.1.14 is _Earthquake_.

##### Bug

- Syslog incorrect dates being parsed into database (Issue [NMS-10605](http://issues.opennms.org/browse/NMS-10605))
- Cannot use poller:poll karaf command with WsManMonitor through Minions (Issue [NMS-12365](http://issues.opennms.org/browse/NMS-12365))
- Upstream Drools Bug: From with modify fires unexpected rule (Issue [NMS-12367](http://issues.opennms.org/browse/NMS-12367))
- “Page Not Found” in alarm-list when choosing number of alarms in dropdown-list (Issue [NMS-12379](http://issues.opennms.org/browse/NMS-12379))
- Elasticsearch event forwarder manipulates in-flight event (Issue [NMS-12390](http://issues.opennms.org/browse/NMS-12390))
Jekyll 301 Redirects on Netlify
Tags: jekyll, netlify, webdev
Published: 2019-12-03 20:35:35

My [personal site](https://wsvincent.com) is built with [Jekyll](https://jekyllrb.com) and hosted on [Netlify](https://www.netlify.com). Recently I needed to implement redirects for my posts on installing Python on Mac, Windows, or Chromebook which now live over at [installpython3.com](https://installpython3.com).

Per the [Netlify docs](https://docs.netlify.com/routing/redirects/), there are two methods available: create a `_redirects` file or a `netlify.toml` file. The former is simpler and worked just fine in my case where I wanted a [301](https://en.wikipedia.org/wiki/HTTP_301) redirect, the default, since the move was permanent and SEO would be maintained as much as possible.

There are two steps required: create the `_redirects` file and then add it to the existing `_config.yml` file.

## Step 1: Create \_redirects file
This involved creating a file called `_redirects` in my project root that contained the URL of a post on this site and then the redirect post it should be sent to separated by whitespace. So for my 3 posts, here's what the file looks like.

```
install-python3-mac/ https://installpython3.com/mac/
install-python3-windows/ https://installpython3.com/windows/
install-python3-chromebook/ https://installpython3.com/chromebook/
```

## Step 2
This one is easy to miss! The existing `_config.yml` file used by Jekyll needs to be updated to include `_redirects`. So at the bottom of `_config.yml` add the following line:

```
include: [_redirects]
```

And that's it! Deploy your site to Netlify per usual and then check that the link redirects properly. There are a number of tools to do this but I found [this one worked well](http://www.redirect-checker.org).
What do you use for server logging?
Tags: discuss, node, docker
Published: 2019-12-03 20:32:13

---
title: What do you use for server logging?
published: true
description: Server side logging
tags: discuss, nodejs, docker
---

I am looking for a good logging solution for my newest project. For reference I just nodejs and docker. Scanning docker logs isn't the best solution. On previous projects I used cloudwatch from AWS (which is great) but I want to avoid using any AWS services on this project. Some criteria I'd enjoy.

* Picks up directly from docker logs no need to change my application code.
* Well priced. I won't be generating that many logs.
* Mildly searchable. I don't need to look back on logs that often.
* 30 day retention. Don't need much more than that.
* Cloud hosted. I don't want to setup more infrastructure for logging.
* Preferably run by a smaller company. I like using services away from huge tech companies. For instance I use postmark for emailing. 

What do any of you use for your logging services. What do you like about them?
#7DaysJS: Where is My Element
Tags: javascript, challenge, beginners
Published: 2019-12-04 02:46:16

---
title: #7DaysJS: Where is My Element
published: true
date: 2019-12-03 20:20:00 UTC
tags: javascript, challenge, beginners
canonical_url: https://lautarolobo.xyz/blog/7-days-of-js-where-is-my-element/
cover_image: https://lautarolobo.xyz/images/7daysJS-7f7d8328.webp
description: Let's work with indexes and arrays!
---

Welcome to day 5 of 7 Days of JavaScript! Today we will code a classic function that:

- Takes two parameters: an element and an array of elements
- Returns the position of the element inside the array. If the element is not in the array, returns -1.

Wish you luck!

You can see the solution [here](https://lautarolobo.xyz/blog/solution-to-day-5-of-7-days-of-js/ "Solution to Day 5 of 7 Days of JS").
Deploy utilizando FTP
Tags: ftp, deploy, gulp, javascript
Published: 2019-12-03 20:08:33

---
title: Deploy utilizando FTP
published: true
description: Olá! Vou demonstrar a utilização do Gulp para enviar arquivos diretamente para um servidor por FTP.

tags: ftp, deploy, gulp, javascript
---

Olá!

Após algum tempo pesquisando uma forma de não precisar utilizar um cliente FTP (modo visual), encontrei o vinyl-ftp.

O [vinyl-ftp](https://www.npmjs.com/package/vinyl-ftp) é um script que abstrai a utilização de um cliente FTP (Filezilla, …).

Iremos utilizar o Gulp para automatizar o processo.

Primeiro é necessário instalar os pacotes *gulp*, *gulp-util*, *vinyl-ftp*:

```
npm install gulp
npm install gulp-util
npm install vinyl-ftp
```

Após a instalação, na pasta de seu projeto, crie o arquivo Gulpfile.js com o seguinte conteúdo:

```
'use strict';

var gulp = require('gulp');
var gutil = require('gulp-util');
var ftp = require('vinyl-ftp');

var user = 'usuarioftp';
var password = 'senhaftp';
var host = 'ftp.site.com.br';
var port = 21;

/*
* Arquivos que serão ou não enviados ao servidor,
* para não enviar um arquivo ou pasta se deve inserir o ! (exclamação) antes do arquivo ou da pasta
*/
var localFilesGlob = ['./**/*',
                        '!node_modules'
                        '!.git'
                        '!composer.*'
                    ];

/*
* Pasta do servidor para onde os arquivos serão enviados
*/
var remoteFolder = '/public_html'

/*
* Função para conexão
*/
function getFtpConnection()
{
    return ftp.create({
        host: host,
        port: port,
        user: user,
        password: password,
        parallel: 5,
        log: gutil.log
    });
}

/*
* Tarefa que enviará os arquivos
*/
gulp.task('ftp-deploy', function()
{
    var conn = getFtpConnection();
    return gulp.src(localFilesGlob, {base: '.', buffer: false})
        .pipe(conn.newer(remoteFolder)) // only upload newer files
        .pipe(conn.dest(remoteFolder));
});
```

Para executar a tarefa utilize o comando abaixo:
```
gulp ftp-deploy
```

Dessa forma o upload dos arquivos irá acontecer. O ftp-deploy identifica quais arquivos foram alterados, assim, ele não envia arquivos não modificados.
Advent of Code 2019 - Day 1
Tags: clojure, adventofcode
Published: 2019-12-03 20:07:50

# Introduction
My Clojure skills are rarely used, but it is a fun language for thinking outside the box. I'll jump at a chance to apply it. So I jumped at Advent of Code 2019!

[Advent of Code](https://adventofcode.com/2019)

### Day 1.1
The first test was nice and simple for Clojure. Iterating over collections and then summing the result is a breeze.
As I suspected the calculation for the amount of fuel would need to be reused, I broke it into its own function. I was glad I did.

This is the code that produces the correct answer to Day 1.1. I moved the inputs into their own `inputs.clj` file to avoid cluttering my code. `day1_masses` is the input provided by Advent of Code. I packaged it into a vector for index access.
 
```clojure
(ns advent.core
  (:gen-class)
  (:require [advent.inputs :refer [day1_masses]]))

(defn day1_fuel_calc
  "I do the fuel calculation as defined for day 1"
  [mass]
  (- (int (Math/floor (/ mass 3))) 2))

(defn day1_1
  "I take the mass vector and produce a single fuel requirement"
  [mass_vec]
  (reduce + (map day1_fuel_calc mass_vec)))

(defn -main
  "I call the functions for the Advent of Code"
  []
  (println "Day 1.1 - Module masses only:" (day1_1 day1_masses)))
```

### Day 1.2
Once again, the second part of the day utilized some nice Clojure features. In this case, loop/recur. I used the `day1_2` function with map to produce a collection of individual fuel calculations. The additional fuel is calculated per individual mass, not total mass, so having the map/reduce in the `day1_2` function would have been too complicated. For cleanliness, I should really have another function perform the map/reduce and call *that* function from `main`, but it's not overly messy.

The following code produces the correct result.

```clojure
(ns advent.core
  (:gen-class)
  (:require [advent.inputs :refer [day1_masses]]))


(defn day1_fuel_calc
  "I do the fuel calculation as defined for day 1"
  [mass]
  (- (int (Math/floor (/ mass 3))) 2))


(defn day1_2
  "I take the individual masses for each item, work out the fuel requirement for each item, and then recursively calculate the fuel requirement for the fuel"
  [mass]
  (loop [fuel_needed (day1_fuel_calc mass)
         total_fuel 0]
    (if (< fuel_needed 0)
      total_fuel
      (recur (day1_fuel_calc fuel_needed) (+ total_fuel fuel_needed)))))


(defn -main
  "I call the functions for the Advent of Code"
  []
  (println "Day 1.2 - Fuel for the fuel:" (reduce + (map day1_2 day1_masses))))
```
How to Setup Heroku Review App for Rails
Tags: heroku, rails, pipeline, beginners
Published: 2019-12-03 20:01:53

**Problem:** You have a Rails app deploying successfully to Heroku, but as you make changes you don't want to deploy directly to your production app. You want to see your hard-earned edits running remotely first!

**Solution:** Review Apps

<h3>App and Pipeline Setup:</h3>
1. Create app on Heroku per [support docs](https://devcenter.heroku.com/articles/git). Be sure to get your [database](https://devcenter.heroku.com/articles/getting-started-with-ruby#use-a-database) up and running too.
2. From Heroku dashboard, click `New -> Create new pipeline`  
3. On the Production app (far right), add your app.  
4. Enable automatic deploys on the production app with `Configure Automatic Deploys` from the dropdown of your production app. You will be required to connect your GitHub account to Heroku so that Heroku knows which repo to deploy from.

<h3>Make a review app</h3>
1. Inside your pipeline, you'll see 3 columns: Review Apps, Staging, and Production. You've already added your production app from the steps above.
2. Match your pipeline Config Vars with your Production App's.
    - Your config vars are stored under the settings for both the production app and the pipeline. The easiest way to get the Review app up and running is to make sure these match.
3. Make a change to your local repo and `git add`, `git commit` and `git push` to a remote branch.
4. Back in your pipeline, under Review Apps, select `+ New App` and the branch you just pushed up. Click `Create` and watch your app build.
5. Select the `Open App` button on your review app build to see what it looks like on Heroku.
6. Now you can merge your pull request on GitHub into your master branch which will trigger the automatic deploys to your production app.

Notes:
The main difference to the Heroku Pipeline per their documentation on the [New Review Apps - as of November 2019](https://devcenter.heroku.com/articles/github-integration-review-apps) is the ability to create review apps without having to make pull requests - you can make a review app straight from a branch.

Before the November 2019 changes, Heroku had a way of spinning up a custom `app.json` file to help with automatic deployments from pull requests. They don't automatically make one for you anymore, but they have provided [app.json Schema Docs](https://devcenter.heroku.com/articles/app-json-schema) for you to create your own.

Heroku Docs:  
- https://devcenter.heroku.com/articles/getting-started-with-ruby  
- https://devcenter.heroku.com/articles/pipelines   
- https://devcenter.heroku.com/articles/github-integration-review-apps
Interview process
Tags: watercooler, recruitment, career
Published: 2019-11-15 10:56:33

The other week I made a post on LinkedIn.  Here it is
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/4btav19c519b1ydg1dhf.png)

I was absolutely shocked at the response.  I mean, I've never had so many people interact with me on LinkedIn.

The code test in question was via one of those online platforms.  It was pretty soulless.  No interaction with the company who had asked me to do the test, in fact before being asked to do the test I'd had some generic emails from them.

This got me thinking about interview processes.

I've been around the block.  I've had plenty of interviews.  I've held plenty of interviews.  I've hired and I've fired people.

But I've come to the conclusion that the hiring process I would favour in the future would be something like.

1. Initial step, ask the candidate to answer some open ended questions.  These might be - Why you want to work for organisation X?  What skills and experience do you have that will be useful at organisation X?  These questions will enable the candidate to add some personality to the application, and it will also help understand how they communicate with the written word.  Essential for remote roles.  Notice, no CV, no resume.  Just some questions to start off.

2. If the candidate doesn't make it through then tell them.  Give them feedback.  They've invested time, so be nice.  If they do get through, then use it as an opportunity to open up a dialogue, ask some follow up questions, see if they have any questions.

3. This step would be an initial video / telephone conversation with the candidate.  Just to get a sense of who they are, what they're looking for in a role and also give them an opportunity to ask any additional questions.

4. Ask them to do a paid days work.  Yes PAID.  Ask them to do a task, that is realistic to the organisation.  Work with them, let them work with the team.  And I'll repeat - Pay them.  We're not looking for perfection, we're looking to see if the candidate is able to work within the organisation, and to get a sense of how the candidate works.

5. A Follow up discussion on the work they've produced.

6. IF all goes well, then they get to meet the wider team (if they've not done so before) and a bit more of a discussion on the role.  If not then they get good solid feedback why they're not suitable.

7. If they've made it to here, they get offered the role.

I don't pretend this will work for all organisations.  But I genuinely feel it would be a sensible approach for many organisations, and be a pleasant experience for the candidate.

Hiring takes time, it's an investment - and it should be seen as such.

Also, be transparent early on about the salary for the role, the benefit for the role - these are things people want to know early on - so they can make an informed decision before wasting peoples time.
Ionic 4 Indeterminate Checkboxes Tutorial – Select/Unselect All Values
Tags: ionic, indeterminatecheckboxes, selectunselectallvalues, ionic4
Published: 2020-02-07 10:05:25

---
title: Ionic 4 Indeterminate Checkboxes Tutorial – Select/Unselect All Values
published: true
date: 2019-12-03 19:54:34 UTC
tags: Ionic, Indeterminate Checkboxes, Select/Unselect All Values, Ionic 4
canonical_url: https://www.positronx.io/ionic-checkboxes-tutorial/
---

The post [Ionic 4 Indeterminate Checkboxes Tutorial – Select/Unselect All Values](https://www.positronx.io/ionic-checkboxes-tutorial/) appeared first on [positronX.io](https://www.positronx.io).

**In this Ionic 4 tutorial, we will learn how to select and unselect all values of a checkbox in an Ionic/Angular 8 app using Indeterminate prop with the `ion-check` component.**

The Ionic team launched Checkbox Indeterminate state in Ionic 4.1 Hydrogen

The Indeterminate state in Ionic is advantageous for the scenarios where you need to select all or check all the checkboxes.

[click here to read more](https://www.positronx.io/ionic-checkboxes-tutorial/)