teleren/devto huggingface dataset:
VS Code Tip of the week: The JavaScript Debug Terminal
Tags: vscodetips, javascript, node
Published: 2022-09-21 02:42:12

I skipped last week's VS Code tip of the week, but for a great reason. I was in Hawaii for my work offsite!

{% embed https://twitter.com/nickytonline/status/1570632307383627776 %}

VS Code has an integrated terminal. You can open it and use it like you would an external terminal. One cool thing though in VS Code is you can choose different terminals. One terminal you can select is the JavaScript Debug Terminal.


![Context menu to decide which terminal you want to load in VS Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xoejxm8bl2ra8trws3ej.png)

It's a terminal that loads your regular shell, but if you run anything that is Node.js, it will allow you to debug it. This is super powerful and convenient.

You can start an npm script, a node process, anything that starts Node.js and you're able to add breakpoints in VS Code and debug right away.

I always use to run `node --inspect-brk ./some-node-process.js` but now that is no longer required in a lot of cases.

![Debugging JavaScript in VS Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ei14x4k40q0xm7aksey.png)

If you'd like to learn more about the JavaScript debug terminal, check out [the official documenation](https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_javascript-debug-terminal).
Zoho ManageEngine Service Desk Plus Lifecycle Management with Okta Workflows
Tags: workflows, okta
Published: 2022-09-21 01:46:47



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bhb2rfxaxbkyp1wwvxj8.png)

Setup Instructions
This document is designed to provide the required configuration to enable Okta Workflows to provision and deprovision users to ManageEngine / ServiceDesk as Requesters and Technicians.

Step 1 – Create Okta Groups
Go to your Okta tenant’s administration console, go to Directory > Groups and create the following groups:

Requesters
Technicians
These groups will be used to provision users to ManageEngine.

Step 2 – Create Profile Attributes
In your Okta tenant’s administration console, go to Directory > Profile Editor and open the default Okta profile and add the following custom attributes:

requester_id
technician_id
These attributes will be used to store the respective Id’s once the users are provisioned to ManageEngine.

Step 3 – Generate Authorization Code
Go to the Zoho API Console (https://api-console.zoho.com/) and create a new Self Client with the Scope of SDPOnDemand.users.ALL and set the time duration to 10 minutes.

Get the full article at:
https://iamse.blog/2022/09/20/zoho-manageengine-service-desk-lifecycle-management-with-okta-worflows/
Today I intentionally copied a bug
Tags: rewrite, regex, bugs
Published: 2022-09-23 21:57:10

---
title: Today I intentionally copied a bug
published: true
date: 2022-09-21 00:00:00 UTC
tags: rewrite,regularexpressions,bugs
canonical_url: https://jhall.io/archive/2022/09/21/today-i-intentionally-copied-a-bug/
---

Today I was rewriting a function. The function makes an HTTP request with a form-encoded request body. But after preparing the body of the reqeust, it runs it through a regular expression to replace `/%5B\d+%5D=/` with `[]=`.

There’s no comment explaining why this is done, so I have to guess.

I have a couple guesses.

1. The API we’re calling doesn’t like the array indexes (the `\d+` part in the regular expression).
2. The API we’re calling doesn’t properly unescape the `%5B` and `%5D` sequences.
3. Maybe both?

I really suspect it’s #1. If the case were #2, surely we’d just replace all occurrences of `%5B` with `[` and `%5D` with `]`, not only the occurrences with digits between.

But that leaves the question: Why don’t we replace matches with `%5B%5D=`? Why do we un-escape these characters, too?

So what did I do?

I copied this dubious behavior into my new function. Even though it’s sloppy and confusing, it’s probably harmless. And removing it is sure to cause problems, since I don’t know exactly what behavior it’s trying to correct for.

What’s the lesson? Two, I think:

1. Make your code obvious. If you can’t explain why the code exists with the function name, use comments.
2. Rewrites are dangerous. Code, no matter how poorly organized and ugly, contains months or years of accumulated bug fixes and wisdom. As tempting as it is to rewrite, do it carefully, lest you re-introduce bugs you don’t understand!

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Remove duplicates from sorted array
Published: 2022-09-21 01:24:50

[Remove Duplicates From Sorted Array Leetcode](https://leetcode.com/problems/remove-duplicates-from-sorted-array/)

So in order to remove the duplicates from the sorted array without creating a new array, I had to traverse through the given array and delete any next element that equals the current element

1. create an incrementing value i and set it to 1

2. Traverse through the nums array

3. check for edge cases to avoid going over the range of the array's index

4. loop through the next ith elements to check if they are equal to the current element

5. remove any ith element that is equal to the current element 

6. If the ith element is not equal to the current element, increment i 

7. break out of the loop if edge cases are met i.e if i is greater than or equal to the length of the nums array

Using this approach gives you the array in memory without duplicates so you can return the length.

You can view my code in python through [Remove Duplicates From Sorted Array](https://github.com/nodebe/dsa_challenges/blob/main/easy_remove_duplicates.py)
Release 0.1 - DPS909
Published: 2022-09-21 00:59:42

The application I created to create static website is called SSGifier. It is a command line application with a pretty straight foreword logic of using. 
This software mainly accepts 5 types of arguments, which are:
`-v --version - prints out the version of SSGifier. 
-o, --output - an optional argument which specifies the output directory, the directory " dlist" is used by default.
-i, --input - specify the input files\directory for the application to convert, this is an necessary argument.
-s, --stylesheet - an optional argument which specifies the stylesheet for the HTML pages.
-h, --help - show help.`
To use it we can just simply use command: ssgifier -i ./Sherlock-Holmes-Selected-Stories
If we want to specify the output folder, we can use: ssgifier -i ./Sherlock-Holmes-Selected-Stories -o outputfolder

If we want to specify the stylesheet, we can use: ssgifier -i ./Sherlock-Holmes-Selected-Stories -s https://cdnjs.cloudflare.com/ajax/libs/tufte-css/1.8.0/tufte.min.css

To check out the code, please visit my repository on Github:
https://github.com/liutng/SSGifier
How to get rid of unwanted access log entries
Tags: nginx
Published: 2022-09-21 00:18:46

The NGINX access logs contains quite a lot of valuable information that helps provide insights into what content visitors are trying to access, how NGINX responds to the requests, and provides metadata about the visitor requesting the information.

This information is super valuable when it comes to managing your websites, keeping your users happy, and providing insights on how your setup can be fortified.

However, the logs can also easily get out of hand and get filled up with useless and undesirable information that makes it more difficult to scan logs for things that you're actually interested in. Some users even report Fail2Ban locking some of their site visitors out for misinterpreting harmless activity...

To filter out undesireable logs, we can leverage NGINX variables and apply an `if` statement to our logging directive.

We'll provide a couple of examples. One at the user agent level and another at the directory / file extension level.

In Cleavr, go to your Site > Site NGINX Config.

```

# Map user agent and filter out logs from known clients, such as WP Rocket or an uptime monitor

map $http_user_agent $loggable {
    "WP Rocket" 0;
    default     1;
}

# Map a request URI, check for extensions to ignore

map $request_uri $loggable {
    ~*\.(ico)$  0;
    default     1;
}

# Then, add the if statement to the logging directive
server {
    access_log /var/log/nginx/example.com-access.log    combined if=$loggable;
    access_log /var/log/nginx/access.log                combined if=$loggable;
}

```

In the above, we are defining a variable `loggable`. You can use whatever variable name you'd prefer. We're also assigning a `0` to criteria in which we do not wish to log, such as requests from 'WP Rocket' as well as requests being made for `.ico` extensions.

We hope this helps you get your access logs nice and tidy so that you can get the most use out of them without being distracted.
HTTP Response Codes to use for API
Tags: httpstatus, api
Published: 2022-09-21 00:18:31

- **200** Everything is ok.
- **400** Valid data was given but the request has failed.
- **401** Unauthorized, No valid user API Key was given.
- **403** Forbidden, Client app does not have access.
- **404** The request resource could not be found.
- **422** The payload has missing required parameters or invalid data was given.
- **429** Too many attempts.
- **500** Request failed due to an internal error.
- **503** Offline for maintenance.
Login with Logify
Tags: sso, auth, webdev, programming
Published: 2022-09-21 00:00:16

Are you a beginner looking to add an authentication service to your project? Well, you may have heard of "Login with Google" or "Login with Facebook," but have you considered the long-term implications of your choice?

At this stage, it's easy to opt for any login service, but what happens when your project grows, and you require advanced features that other providers may not offer or require payment? This could halt your project's growth, leaving you frustrated and disappointed.

Enter **Login with Logify** - the solution to all your problems. With us, you get access to advanced features for free, allowing you to focus on the core functionality of your project. No more worrying about access management, no more worrying about the financial implications of using a login service.

Our service is designed to help your project grow without limitations, enabling you to take advantage of advanced features without the need for payment. Whether you're a small startup or a large corporation, **Login with Logify** is the perfect choice for your authentication needs.

So why wait? Sign up today and experience the freedom of using Login with Logify - the authentication service designed with your success in mind.
Dotnetsheff GitHub Security Features
Published: 2022-09-22 21:16:42

---
title: Dotnetsheff GitHub Security Features
published: true
date: 2022-09-21 00:00:00 UTC
tags: 
canonical_url: https://devopsjournal.io/blog/2022/09/21/dotnetsheff-github-security-features
---

* * *

layout: post title: “Presentation dotnetsheff - Protect your code with GitHub security features” date: 2022-09-21 —

I have the pleasure of virtually speaking at [dotnetsheff](https://dotnetsheff.co.uk/) and these are the slides for it:

Creating modern software has a lot of moving parts. We all build on top of the shoulders of giants by leveraging closed/open source packages or containers that other people have shared. That makes securing our software a lot more complex as well!

In this session you’ll learn what possible attack vectors you need to look for, how to protect yourself against them and how to leverage GitHub’s features to make your life easier!

Topics:

- Signed Commits
- Dependabot updates
- Dependency scanning for known vulnerabilities
- Secret scanning (and revoking) out of the box
- Using CodeQL

You can download the slides [here](https://devopsjournal.io/slides/20220921%20dotnetsheff%20-%20Protect%20your%20code%20with%20GitHub%20security%20features.pdf).

[![Opening slide of the presentation](https://devopsjournal.io/images/2022/20220921/20220921_OpeningSlide.png)](https://devopsjournal.io/slides/20220921%20dotnetsheff%20-%20Protect%20your%20code%20with%20GitHub%20security%20features.pdf)
Online Meetup: Build Your First No-Code Workflow Automation in 25 Minutes
Tags: beginners, webinar, nocode, okta
Published: 2022-09-20 23:00:10

Join another Okta Workflows online meetup ✨

🔮 **Why it’s worth your time**

Join this (fun) no-slides online meetup to learn how to process a list using a helper flow in [Okta Workflows](https://www.okta.com/platform/workflows/) in 25 minutes. 

🎟 **When and register**

* When: Wednesday, September 28, 9 a.m. PT
* I want to attend: [register now](https://www.crowdcast.io/e/build-first-nocode-workflow-automation)

🔭 **You will learn**

You will learn step-by-step how to build your first no-code workflow automation and also: 

* Building a flow with the basic building blocks (events, schedule, actions, functions, and connectors)
* Testing and running a flow

And, stick around to get your questions answered. This is a no slides session (well, maybe just one or two at the beginning).

👷🏻 **Who should attend**

Everyone is welcome of course, but if you want to know, these folks should attend:

* Folks who are new to Workflows!
* Folks who want to learn about No-Code, workflows and automation
* IT Administrators, Integration Architects
* Product Manager, Developers, Marketing Operations and Technology Leads
* DevOps Engineers and Security Engineers

🎙 **Speaker**

* Max Katz, Workflows Community Advocate (yes, that’s me 😜)

🎥 **Previous online meetups**

Looking for previous online meetups recordings? Go to our YouTube channel to [watch all previous events](https://youtube.com/playlist?list=PLIid085fSVdvyK8F4xuk49EchBPmAVNHG).
A third-party Python Client for Spotify (and tips on how to make your own...)
Tags: python, spotify, gui
Published: 2022-09-20 22:47:20

[![ReSpotGUI](https://raw.githubusercontent.com/digfish/respotgui/master/respotgui.png "ReSpotGUI")](https://raw.githubusercontent.com/digfish/respotgui/master/respotgui.png "ReSpotGUI")
The integration of Spotify, the great daddy of audio streamers with third-party apps has been difficult over the years. Years ago, in their beginning they liberated [libspotify](https://mopidy.github.io/libspotify-archive/), coded in for integration with different clients. Integration with major audio players like [Foobar](https://www.foobar2000.org/components/view/foo_spotify
), [Clementine](https://www.clementine-player.org/) and [MusicBee](https://www.getmusicbee.com/addons/plugins/185/spotify-integration-plugin) were working, but in 2015 the company decided to drop the new development on the library and decided to shut down the integration last June.
The new feature called Spotify Connect that allows multiple device to act as remote controller for the device that its playing in real time made new possibilities. But the wheel was inventend with [LibReSpot](https://github.com/librespot-org/librespot), a library written in [Rust](https://www.rust-lang.org/). More libraries ported from the original in Rust appeared later in [Go](https://github.com/librespot-org/librespot-golang) and [Java](https://github.com/librespot-org/librespot-java). This last one is special, since it allows to be controlled by [HTTP requests](https://github.com/librespot-org/librespot-java/blob/dev/api) and interacts with a potential client through [WebSockets](https://github.com/librespot-org/librespot-java/blob/dev/api). So a good player is possible to be built through a GUI library, and so I picked the most user friendly GUI framework, [PySimpleGUI](http://pysimplegui.com/), that wraps multiple and more complex GUI frameworks like Tkinter and PyQT providing easyness of development.

{% embed https://codehouse.digfish.org/respotgui/ %}
Study: Developers wait 4+ Days on Average for Their Pull Requests to be Picked Up
Tags: todayilearned, devops, programming, productivity
Published: 2022-09-20 22:38:01

{% youtube U2RSQGEajnI %}

Dan Lines and Ori Keren joined forces to create LinearB, a software engineering metrics tracker,  a few years ago, and since then have researched the ins and outs of what makes a great productive engineering team. In this episode of Dev Interrupted, co-host Conor Bronsdon takes the helm as they discuss the biggest engineering pain point that teams aren't addressing, and what you can do to start changing the game. [Watch the full podcast here!](https://www.youtube.com/watch?v=tAlD-pasXZ4)

-------------------------------------

## [You’re invited to Interact on October 25th!](https://devinterrupted.com/event/interact/?utm_source=dev.to&utm_medium=referral&utm_campaign=202210%20-%20Event%20-%20Interact%20-%20Referral%20-%20Distro%20-%20Podcast%20Blog)

*Want to know how engineers at Slack and Stripe connect their dev teams’ work to the business bottom line? Or how team leads at Shopify and CircleCI keep elite cycle time while minimizing dev burnout and maximizing retention?*

*These are just two of the topics we’ll tackle at [Interact](https://devinterrupted.com/event/interact/?utm_source=dev.to&utm_medium=referral&utm_campaign=202210%20-%20Event%20-%20Interact%20-%20Referral%20-%20Distro%20-%20Podcast%20Blog) on October 25th.* 

*A* ***free, virtual, community-driven engineering leadership conference,*** *[Interact](https://devinterrupted.com/event/interact/?utm_source=dev.to&utm_medium=referral&utm_campaign=202210%20-%20Event%20-%20Interact%20-%20Referral%20-%20Distro%20-%20Podcast%20Blog) is a one-day event featuring over 25 of the most respected minds in development, all selected by the thousands of engineering leaders in the Dev Interrupted community.* 

## [Register now!](https://devinterrupted.com/event/interact/?utm_source=dev.to&utm_medium=referral&utm_campaign=202210%20-%20Event%20-%20Interact%20-%20Referral%20-%20Distro%20-%20Podcast%20Blog)


![Register now!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9xpvwbw5xfawom98qga.jpg)
Day 624 : Rest Well
Tags: hiphop, code, coding, lifelongdev
Published: 2022-09-20 22:14:31

_liner notes_:
- Professional : First day at work back at home. Had a meeting with my manager. Reviewed some PRs. Investigated some projects that I may be working on in the future. Keeping it light since I got back home early this morning.

- Personal : So, I made it back from my trip from Japan and Korea. Can't say how much of an amazing experience this was. Thanks to everyone that made it possible and all the folks I met. Finished uploading all the pics and videos up at https://doingstuff.in .

![Tall rock formations in Tassili n'Ajjer Park, Algeria with mountains in the distance at sunrise](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rjvbrh983xx0pbq0dusy.png)

Going to rest up more since coming back home. Probably catch up on some shows I missed while traveling. Trying to rest well before my next trip. I may work on some stuff for a side project. We'll see.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube 8JKvsaf7VDc %}
Débuter avec Angular 14: #5 Le two way data binding ou le banana in the box 🍌 ️📦
Tags: angular, typescript, javascript, frontend
Published: 2022-09-20 22:12:18

---
title: Débuter avec Angular 14: #5 Le two way data binding ou le banana in the box 🍌➡️📦
published: true
description: On a appris ce qu'était le Data binding, L'Event binding, maintenant combinons les deux
tags: angular, typescript, javascript, frontend
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---

S'il y a bien un truc que j'avais adoré lorsque j'ai appris Angular pour la premiere fois (c'était en 2016 avec Angular 2) c'est le fait de pouvoir faire de Data/Event binding en meme temps.

Tu vas me dire, oui mais Sid Ali, dans quelle exemple pourrais-je avoir besoin.

Petite enigme alors:
Je te permets de m'écrire, je t'écris ce que tu m'écris

Je suis un...Input!

Une petite configuration est de rigueur avant de pouvoir utiliser cette magie, il te faut modifier le fichier `app.module.ts` pour y ajouter le `FormsModule`

```ts
import { FormsModule } from '@angular/forms';

[...]

@NgModule({
  imports: [
    [...]
    FormsModule
  ],
  [...]
})
```

Maintenant que c'est fait, on peut modifier notre template `app.component.html`

```html
<h1>{{ title }}</h1>
<input [(ngModel)]="title" />
```


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5xq4giai6k2dm23go4s.gif)


Me mettrai un petit dessin explicatif demain in-chat-là, sinon après demain (des empire se sont construire avec la procrastination)
Il est l'heure d'aller me coucher
Unhex - convert colors to RGB, HEX or HSL in bulk
Tags: javascript, typescript, webdev, colors
Published: 2022-09-20 21:27:21

Working on a large codebase with multiple css files, inline styles and tech lead says all colors now gotta be as HSL?

Changing 1 by 1? Forget that.

In this tutorial we will discover unhex - a nodeJS package that replaces all the colors in all the files you choose in a given directory.

[Github Repository](https://github.com/aspnxdd/unhex/)

[npm link](https://www.npmjs.com/package/unhex)

Go to your project root directory and run `npx unhex@latest` a CLI inquirer will appear. Select which file extensions you wish to modify, ignore any files (like node_modules) and you are ready to go!

All the files matching your configuration will be parsed and modified to whatever color representation you chose!


![Logs of running npx unhex@latest](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4e2wwmdcgp2ofyparn9c.png)
I'll teach you 7 Array methods. (with animations!)
Tags: javascript, array, beginners, programming
Published: 2022-09-20 21:22:04

## map 
Creates a new array populated with the results of a provided function on every element.
```js
[1, 2, 3].map( n => n * 2 ); // [2, 4, 6]
```
![11](https://user-images.githubusercontent.com/45242501/191165459-eb59d0f8-1188-4119-8b9d-ae422150d97c.gif)

## filter
Creates a Copy of a portion of a given array, filtered down to just the elements from the given array that pass the test, keep in mind that changes of your first array will affect your copy.
```js
[1,2,3].filter( n => n !== 2 ); // [1,3]
```
![22](https://user-images.githubusercontent.com/45242501/191168509-c1c53a6a-cfdb-49c7-aa2c-336859ec19ff.gif)

## find
Stops and returns the first element in the provided array that satisfies the provided testing function, otherwise returns undefined. 
```js
[1,2,3].find( n => n == 2 ) // 2
```
![33](https://user-images.githubusercontent.com/45242501/191170544-e4fc3b96-e4bf-4fb5-8636-c81e72ac7f74.gif)

## findIndex
Returns the index of the first element that satisfies the provided testing function. Otherwise -1 is returned.
```js
[1,2,3].findIndex( n => n == 2) // 1
```
![44](https://user-images.githubusercontent.com/45242501/191172188-9446e69f-4e72-452e-b090-227da04e3824.gif)

## fill
Changes all elements in an array to a static value, from a start index (default 0) to an end index (default array.length). It returns the modified array.
```js
[1,2,3].fill('Txt', 1,2) // [1,'Txt', 3]
```
![77](https://user-images.githubusercontent.com/45242501/191353910-e16f99ac-0845-43fd-9da5-c1e2cfec7a8d.gif)

## every
Tests all elements in the array. After finished returns a Boolean value
```js
[2,2,2].every( n => n == 2 ) // true
```
![88](https://user-images.githubusercontent.com/45242501/191357036-0d78d7e4-c5b5-40a3-8faf-ce460e7acc14.gif)

## some
Tests whether at least one element in the array passes the test implemented by the provided function. 
```js
[1,2,3].some( n => n == 2) // true
```
![99](https://user-images.githubusercontent.com/45242501/191358482-ddec7b8d-82c8-4ea9-9599-e85e4fd646ab.gif)

### 👇 Follow me on Twitter

[![Twitter](https://img.shields.io/twitter/url.svg?label=Follow%20%40fsandovaldev&style=social&url=https%3A%2F%2Ftwitter.com%2Ffsandovaldev)](https://twitter.com/fsandovaldev)