teleren/devto huggingface dataset:
Hobby Project: Dev.to API Issues
Tags: api, devto
Published: 2020-01-16 01:22:00

I think my first objective is going to be extraction of posts so that they can be added to a repository. To do this I need to understand the data I am getting, but also keeping in mind the main goal of publishing and updating articles.

# Pull Missing Data 

When grabbing articles it looks like the series assigned is not provided. This isn't a problem because updating does not need to specify all data.

You receive the organization, but putting an article needs tho organization ID. 

# Meta Duplication 

Dev original placed meta data within the content itself, front matter, this is still supported, and takes precedence.

This isn't a problem, either the user manages the content or this library could allow normalization. I wonder if dev.to would have issue with an API update only doing partial normalization (recall my profession is QA). 

# Update the Changed

Publishing to an external system is going to be a challenge. See the usual CI/CD is to create a package and push out the whole thing.

In the case of dev.to this would mean updating every article every commit (or arbitrary rule). This isn't exactly fair or the expected use of the api. 

How did the implementation I originally mentioned handle this? It provided a separate file to specify what the CI should publish. I expect items modified would enter this list and then leave.

What is a better way? Well git will store file modification timestamps, this could then be queried from the file system. However this needs to be compared with a last published date.

Dev.to will provide to modification time, however this being REST and not graphQL this means pulling all data, almost as bad as publishing all data.

Pipelines are not designed to modify the repository, for good reason. Thus having the publish step archive its work is not really in the cards.

So what is the answer? We need to establish a point of publication, tags are a good way to do this. If we publish on a tag the git can be asked for the files changed between it and the previous tag. 

But this has a problem. What if publication fails? The next tag expects the previous tag to have published. At this point my thoughts are to request the failed tag be removed from the server. Which has its own problems. Git won't delete tags from a repository like it does with branches and --prune. We also could create several local branches and push them up and only the last change set would publish. 

# Promotion

Concider following me if you liked the article. Check out my profile to see if you enjoy my other writings. I cover git, testing, D, and more.
Building the World's Simplest CMS in Javascript
Tags: javascript, html, css, 7projects
Published: 2020-01-16 01:05:51

---
title: Building the World's Simplest CMS in Javascript
published: true
description: Describes how I built a simple CMS using Javascript, HTML and CSS.
tags: Javascript, HTML, CSS, 7 Projects
---

# Worlds Simplest CMS
## Introduction
This is an example of how to build the World's Simplest CMS using HTML, CSS, and Javascript. The full code can be found at: https://codepen.io/philipmunce/pen/KKwxKRE and I am building this myself to be able to create an easy to use static site generator, and also to work through the 7 projects in 7 days Twitter challenge.  Any feedback would be appreciated
## Architecture
### Content
The content for each page is held within the HTML document itself inside a `<div id="contentEdit"></div>` section.  Any text inside this section will render as HTML provided that text is entered as markdown.
### Template
  A `<div class="page"></div>` is provided to wrap the page content.  Inside the div is a `<div class="contentDisplay"></div>`, this div should be left as is.
### CSS
The CSS is used to hide the contentEdit section which will be rendered in the javascript. An example is also given of how to format a code section in the output:
```
  .page #contentDisplay code {
  background-color: #FFFF99;
}
```
In this case I have set up the template to display a yellow background highlight for code blocks.
### Javascript
The Javascript works by loading the contents of contentEdit into memory and then rendering the content from Markdown to HTML using the Showdown library, see [Showdown](https://github.com/showdownjs/showdown) for more information about this library. 
```
const content = document.getElementById('contentEdit').innerHTML;
const converter = new showdown.Converter();

document.getElementById('contentDisplay').innerHTML = converter.makeHtml(content);
```
## Next Steps
The next steps for this are to look at:
* supporting multiple sections to be able to create a landing page, 
* to support scripting to render a static site, 
* to support tables, and 
* to better support line breaks in the input.
Hello World
Published: 2020-01-16 00:58:45

## About

Just testing out this site and what it can do.


## Markdown

Markdown is pretty basic, wonder why they don't allow full **HTML**

## ME

I am just a gamer that likes to play around with projects, and happen to know enough coding to get around 

## Projects

I help and contribute to a few projects where I am a volunteer like [Minds.com GitLab](https://gitlab.com/minds)

I also like building and testing things in general we use [Glitch](https://glitch.com/@MindsGaming) to cooperatively work with others and tune our coding skills.

## Website

Our website [#MindsGaming](https://mindsgaming.glitch.me) is a place to help users on [Minds.com](https://www.minds.com/register?referrer=MindsGaming) find groups to grow views and interactions on content. 

# TEST COMPLETE
---------------
<code> This test is completed </code>
Limit Bandwidth through Terminal
Tags: linux, networking
Published: 2023-01-06 01:44:38

---
title: Limit Bandwidth through Terminal
published: true
date: 2020-01-16 00:51:45 UTC
tags: Linux,Networking
canonical_url: https://brandonrozek.com/blog/limitbandwidth/
---

Have you ever wondered how an application or a system would operate under low bandwidth environments? Luckily `wondershaper` is a tool to help with just that!

```
sudo apt install wondershaper

```

To get started, first find out the network `interface` that you want to throttle.

```
ip addr show

```

To show the state of the interface,

```
sudo wondershaper [interface]

```

To set the bandwidth,

```
sudo wondershaper [interface] [downlink] [uplink]

```

where downlink and uplink are defined in kilobits per second.

To clear the rules,

```
sudo wondershaper clear [interface]

```
Starting activities with buttons using Kotlin
Tags: kotlin, android
Published: 2020-01-16 00:26:48

I just started android development and i had some issues which i would like to address for beginners so that they wouldn't have to go through too much stress to solve issues relating to android development with the Kotlin programming language.


First of all you have state the id for your button so let's assume the id for my button = btnLogin
You will call on "setOnClickListener" which listens to button clicks, then you will have to call on the name of the activity in order to start it.
"this" refers to the context of the application

btnLogin.setOnClickListener {
       startActivity(Intent(this, LoginActivity:class.java))
}



Thanks for reading.
React 16 Datepicker Tutorial with react-datepicker Examples
Tags: react, javascript, react16datepicker
Published: 2020-02-01 20:07:57

---
title: React 16 Datepicker Tutorial with react-datepicker Examples
published: true
date: 2020-01-16 00:17:27 UTC
tags: React, JS, React 16 Datepicker
canonical_url: https://www.positronx.io/react-datepicker-tutorial-with-react-datepicker-examples/
---

The post [React 16 Datepicker Tutorial with react-datepicker Examples](https://www.positronx.io/react-datepicker-tutorial-with-react-datepicker-examples/) appeared first on [positronX.io](https://www.positronx.io).

**Welcome to How to Implement and use Datepicker in React application! In this tutorial, you will learn the step-by-step process of integrating and using react-datepicker modules in React.js.**

The React datepicker is a compelling and reusable component used for displaying the dates using a calendar dialog.

[Click here to read more](https://www.positronx.io/react-datepicker-tutorial-with-react-datepicker-examples/)
Full stack developer is the most misunderstood word in tech
Published: 2020-03-31 14:04:37

---
title: Full stack developer is the most misunderstood word in tech
published: true
date: 2020-01-16 00:00:00 UTC
tags: 
canonical_url: https://learnwithparam.com/blog/full-stack-developer-is-the-most-misunderstood-word-in-tech/
---

I recently started creating twitter threads. I liked it! Here is my first thread.

{% twitter 1217135078532354050 %}

As a full-stack developer, this is what I feel about full-stack development. Please share your replies on the twitter thread. Hope this helps or triggers you 😅
How to Create SECRET_KEY for Django Settings
Tags: python, django, env, secret
Published: 2020-04-17 15:06:52

---
title: How to Create SECRET_KEY for Django Settings
published: true
date: 2020-01-16 00:00:00 UTC
tags: python, django, env, secret
canonical_url: https://tech.serhatteker.com/post/2020-01/django-create-secret-key/
---

When you start a django project, `django-admin startproject` automatically adds a randomly-generated `SECRET_KEY` to each new project.

However if you want to change it, or add a seperate one to each of your
environment, e.g: one for 'production', one for 'staging', one for 'production' etc, how do you gerenerate a new ones?

There would be another case: you cloned a project from a remote repo and want to change the default `SECRET_KEY`.

For sure there are some other solutions but I believe that the best solution comes from native Django itself; `get_random_secret_key`:

```py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# generate_secret.py
from django.core.management import utils


print(utils.get_random_secret_key())
```

When we run above codes it returns a 50 character random string usable as a `SECRET_KEY` setting value.

In the above snippet as you can see we are using [get_random_secret_key] function from django's `utils` module.

In addition to that if you'd like to use it as a 'one-liner' command run it like below:

```bash
$ python manage.py shell -c 'from django.core.management import utils; print(utils.get_random_secret_key())'
```

All done!

[One example]: https://gist.github.com/ndarville/3452907
[get_random_secret_key]: https://github.com/django/django/blob/9386586f31b8a0bccf59a1bff647cd829d4e79aa/django/core/management/utils.py#L77
How to create custom checkbox and radio inputs with CSS
Tags: css
Published: 2020-01-16 15:55:16

---
title: How to create custom checkbox and radio inputs with CSS
published: true
date: 2020-01-16 00:00:00 UTC
tags: css
canonical_url: https://alexcarpenter.me/screencasts/2019/11/custom-inputs/
---
{% youtube 54YeIQ7Eo_g %}

One major thing I forgot to outline in the screencast is ensuring there is a focused state applied to the custom indicator when the user has focused the input. The code provided below includes a focus state.

```css
<!-- checkbox -->
<label class="control">
  <input type="checkbox" class="control__input visually-hidden">
  <span class="control__indicator"></span>
  Blue
</label>

<!-- radio -->
<label class="control">
  <input type="radio" name="color" class="control__input visually-hidden">
  <span class="control __indicator control__ indicator--radio"></span>
  Blue
</label>


.control {
  display: inline-flex;
  align-items: center;
}

.control__indicator {
  margin-right: .25rem;
  width: .75rem;
  height: .75rem;
  background-color: #ccc;
  border-radius: 3px;
}

.control__indicator--radio {
  border-radius: 50%;
}

.control __input:focus ~ .control__ indicator {
  box-shadow: 0 0 0 0.2rem rgba(38,143,255,.5);
}

.control __input:checked ~ .control__ indicator {
  background-color: #05f;
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4gIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gIDxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xOCA3bC0xLjQxLTEuNDEtNi4zNCA2LjM0IDEuNDEgMS40MUwxOCA3em00LjI0LTEuNDFMMTEuNjYgMTYuMTcgNy40OCAxMmwtMS40MSAxLjQxTDExLjY2IDE5bDEyLTEyLTEuNDItMS40MXpNLjQxIDEzLjQxTDYgMTlsMS40MS0xLjQxTDEuODMgMTIgLjQxIDEzLjQxeiIvPjwvc3ZnPg==');
  background-size: 80%;
  background-position: center;
  background-repeat: no-repeat;
}

/* Visually hide the browser input to ensure it is still focusable via keyboards */

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}
```

[Here's a demo on CodePen](https://codepen.io/alexcarpenter/pen/rNNbwqB) that you can play with.
Pattern match in with clause 🤯
Tags: elixir, todayilearned
Published: 2020-01-15 23:58:37

---
title: Pattern match in with clause 🤯
published: true
tags: elixir, todayilearned
canonical_url: http://til.ryanwill.dev/posts/i8spykdvzy-pattern-match-in-with-clause-
---

I had a problem where I needed to make sure a string was returned from a function that was part of a with clause. I thought, “You can’t pattern match here, right? That would just be too convenient.”

Turns out you totally can. Here’s an example from the docs.

```elixir
users = %{"melany" => "guest", "bob" => :admin}

with {:ok, role} when not is_binary(role) <- Map.fetch(users, "bob") do
  {:ok, to_string(role)}
end
```
On.NET Episode: Messaging with Azure Event Hubs
Tags: azure, dotnet, messaging, microservices
Published: 2020-01-15 23:46:42

In this episode, [Serkant Karaca](https://twitter.com/KaracaSerkant) and [Shubha Vijayasarathy](https://twitter.com/ShubhaVijaya) from the Azure Event Hubs team join us to talk about how and when to use Azure Event Hubs as the messaging component in our .NET applications. They'll discuss use cases, cover topics like partitioning and also show how to use the .NET SDK for Event Hubs.


{% youtube DDDjFQSQyF4 %}

If you liked this video and would like to see some more of our .NET content, please subscribe to our [.NET Developers YouTube Channel](https://www.youtube.com/channel/UCvtT19MZW8dq5Wwfu6B0oxw).


## Useful Links
* [Azure Event Hubs Documentation](https://docs.microsoft.com/en-us/azure/event-hubs?WT.mc_id=ondotnet-devto-cephilli)

* [GitHub repo with samples](https://github.com/Azure/azure-event-hubs/tree/master/samples/DotNet/Microsoft.Azure.EventHubs?WT.mc_id=ondotnet-devto-cephilli)

* [Enable reliable messaging for Big Data applications using Azure Event Hubs](https://docs.microsoft.com/en-us/learn/modules/enable-reliable-messaging-for-big-data-apps-using-event-hubs?WT.mc_id=ondotnet-devto-cephilli)

* [Choose between Azure messaging services](https://docs.microsoft.com/en-us/azure/event-grid/compare-messaging-services?WT.mc_id=ondotnet-devto-cephilli)

* [Azure IoT Documentation](https://docs.microsoft.com/en-us/azure/iot-hub?WT.mc_id=ondotnet-devto-cephilli)

* [Send events to or receive events from Azure Event Hubs using .NET Core](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-dotnet-standard-getstarted-send?WT.mc_id=ondotnet-devto-cephilli)

* [Microsoft.Azure.EventHubs NuGet package](https://www.nuget.org/packages/Microsoft.Azure.EventHubs?WT.mc_id=ondotnet-devto-cephilli)
a node express pug demo for GLITCH and ZEIT
Tags: node, glitch, zeit, demo
Published: 2020-01-15 23:37:24

since the marketing dept at zeit deleted the zeit node express docs, examples and repos last year i am now trying to recreate one that works with both [glitch](glitch.com) and [zeit](zeit.co)

it would appear that zeit have created a fake node express interface (called helpers!) that lock you into the zeit platform instead of other platforms such as glitch

{% github osde8info/zeit-now-express2 %}

refs
https://github.com/zeit/now-examples/issues/432
https://zeit.co/blog/now-node-helpers
Starting Over
Tags: beginners, life, personal
Published: 2020-01-15 23:27:42

---
title: Starting Over
published: true
description: A brain dump of life so far.
tags: beginners, life, personal 
---
It's been almost 4 years since I've graduated from college. I studied web design and development -- and I gotta tell you -- *I didn't learn sh_t*.

I wasn't confident enough to interview as a developer. I was intimidated by the prospect of having to whiteboard code and solve algorithmic problems (I'm terrible at math). I had no idea what the hell "Big O notation" was or even how to properly articulate and explain that infamous "fizz" "buzz" problem.

To tell you the truth, *I still don't*.

About 1.5 years after I graduated, I finally got my foot in the tech door as a contractor for a big, BIG household-name company. I was so proud of myself; I thought I had made it. *SPOILERS: I actually didn't.*

Little did I know that contractors were at the bottom-rung of the barrel. Hell, my manager told me to just make up my title (I chose "UX/UI Specialist"--not quite designer, not quite developer, but I knew a thing or two about both). My job was to audit the UI and UX of the product, tell engineers and designers where everything fell apart across all platforms. I had to pinpoint where in the code-- in various programming languages-- why the hell does this timestamp render differently on each iteration of the product (why are "am" and "pm" capitalized on one platform, and why is it rendering only in military time on the other??? *WHO DID THIS? WHO SAID THIS WAS OKAY?*) 

I digress-- it was a great experience, despite the frustration that came with attempting to decipher the spaghetti that was this product. This lead to a massive overhaul of how this particular team will coordinate building and modifying the product. 

However, I wasn't legally supposed to receive any recognition. I wasn't even supposed to say I worked for the company, but instead, through the contracting place.

It was bullsh_t.

I decided I needed to step up. The path I chose, though, is an expensive one: I enrolled in a software engineering immersive at [General Assembly](http://generalassem.bly). Thankfully I received a scholarship which took off a good chunk of tuition.

I already finished the 60 hours of pre-work, which included reviewing the basics of HTML, CSS, and JS. To kill more time, I'm currently running through the Javascript Algorithms and Data Certification course on freecodecamp.

Essentially, I'm starting over, but I have a good feeling about this. Maybe this time, the basics will stick and I'll finally have the guts to apply to jobs as a developer. 

Wish me luck! 

##Comment on this post with your best advice for coding n00bs!
change language in Microsoft Chromium Edge + other Edge URLs
Tags: edge, microsoft
Published: 2020-01-15 23:14:46

---
title: change language in Microsoft Chromium Edge + other Edge URLs
published: true
description: 
tags: edge,microsoft
---

When I installed Microsoft Chromium Edge it installed in Spanish for some reason. And then it remembered the setting and came up that way!

![edge install in spanish](https://thepracticaldev.s3.amazonaws.com/i/xv7r97y51l700ck8ax3e.png)

I guess when I downloaded it I got it somehow from a Spanish download site even though I went to the US download URL.

To change your language in Chromium Edge go here in the address bar.

edge://settings/languages

You can see other Edge URLs here:

edge://edge-urls/
Data Migration in Active Storage after changing the Model name
Tags: rails
Published: 2020-01-15 22:57:03

## 🤔 What does it mean about 'run a migration'
According to Rails Guide, it says

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/pjsprw2j4atfke2735qb.png)

## ☕️ My Situation
### I changed my model name
- From: Media
- To: Medium

### Then
All of the objects had not had any attachment.

## 🧐 WHY?
ActiveStrage is the polymorphic model. So, the records were still looking at the old model. Then, the association is cut.

## 🔧Treatment from Rails Console

```ruby
ActiveStorage::Attachment.where(record_type: "Media").update(record_type: "Medium")
```
Quick Overview To JavaScript Engines
Tags: javascript, react, angular, vue
Published: 2020-01-15 22:43:31

You don't need to know how the JavaScript engines work in order to learn JavaScript but it's always good to learn how things work under the hood.

Keep in mind that every JavaScript gets interpreted differently depending on what engine your browser is using.

**JavaScript parsing:** This means that your browser reads your javascript code.

**JavaScript execution:** This is the actual process where our code does something.

When the code is **parsed** and **executed** that is when the browsers makes use of the JavaScript engine.

The engine for Google Chrome is called v8, and the one for Firebox its called SpiderMonkey.

For more info on:
Google [V8](https://v8.dev/)
 Firebox [SpiderMonkey](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey)

**Typically the engines have two parts:**

-The Interpreter
-The Compiler (Usually a just-in-time compiler) aka JiT

***Note:*** In this post, we will focus on how the engines generally work, not what the engines do when the code executes.


## The Interpreter

This is where our engine parses/loads our script (JavaScript code), reads it, then translates it to byte code, and finally starts the execution. The byte code is giving to the compiler.

## The Compiler

Compiles your script into machine code. So the translation from JavaScript code to machine code is what our compiler does. 

**Remember:** that just-in-time compilation means that our compiler starts compiling and executing the compiled code.

## JavaScript Engine Does Optimization

If you wrote a script and then modified part of it, the JavaScript engine checks what code didn't change between the last execution and the one that is currently running. The current version not always gets re-compiled. The engine checks what code has been compiled and doesn't compile it again, which makes the engine's process faster.

## Browser APIs

Our browsers come with default functions or objects that work with our JavaScript code. When we make use of this functions or objects that are in our browser APIs, the engine interprets and compiles our code then the browser knows where are these functions or objects coming are from. 

<img src="https://thepracticaldev.s3.amazonaws.com/i/5a87eog40zvcsimuaew4.png" />
Run multiple commands in one line with `;`, `&&` and `||` - Linux Tips
Tags: linux, bash, ubuntu
Published: 2020-01-15 22:32:27

There are 3 ways to run multiple shell commands in one line:

### 1) Use `;` 

No matter the first command cmd1 run successfully or not, always run the second command cmd2:

```bash
# cmd1; cmd2
$ cd myfolder; ls   # no matter cd to myfolder successfully, run ls
```

### 2) Use `&&`

Only when the first command cmd1 run successfully, run the second command cmd2:

```bash
# cmd1 && cmd2
$ cd myfolder && ls  # run ls only after cd to myfolder
```

### 3) Use `||`

Only when the first command cmd1 failed to run, run the second command cmd2:

```bash
# cmd1 || cmd2
$ cd myfolder || ls  # if failed cd to myfolder, `ls` will run
```