teleren/devto huggingface dataset:
CLI Data Gem Project(EVENTCOG)
Tags: ruby
Published: 2020-02-11 00:04:21

“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/q8qc0iw8rwespfhqmuj9.gif)


At the start of this project, I was a little intimidated by its depth; but with the help of my cohort lead and the learn videos I made a program that went beyond my expectations.

My project started out as a scraper for local bars and events. But upon the realization that there are not many choices of websites listing bars in a specific area; I knew I would have to find a search new topic. After coming to this conclusion I watched the API video my cohort lead sent me and came up with the idea of just listing events. So I spent the next hour scouring the web to find an API I could use for this.
 
The process of finding an API then applying for a key was tedious. I went through many APIs before I found one that was free and compatible with what I was trying to do; queue Ticket Master. So with my Ticket Master API in hand and the help of a JSON formatter, I was able to get future events in the USA and easily send this data to my computer to be parsed and saved to a hash. 
 
At this point, I thought I was through the worst of it but I was so wrong. The CLI, and Event class collaboration was tedious. I spent the next four hours typing out my code and testing it in the CLI. I did not find this part difficult it just took much writing then executing to get my associations right.
 
The next morning I added colors to my text and replaced much of the empty space created by my output with line separators. I then let my cohort lead overlook my project. He informed me that I did not have tests for my user input and needed to make my API key private. So using dotenv I moved my key to an env file, created my input tests, and added my finishing touches to my code. I enjoyed creating this project and working with APIs. I really surprised myself with all I was able to output off the top of my head in my program and I now feel extremely confident in this section of the course.
The Data Science Lifecycle
Tags: datascience
Published: 2020-02-11 00:00:47

The data science project goes through phases of discovery, scoping, data analysis, data cleaning, modeling, evaluation, the deployment. The data scientists work collaboratively with ‘the business’ to define a scope with can be realistically solved.

All the tasks up until modeling and deployment roughly take up 80% of the time spent. Figuring out if the problem can be solved, and if there is relevant data to back it up is time consuming.

I spoke with a professional data scientist recently on this topic and they said, “A good chunk of my job is scoping: telling people that ML is a bad solution to their problem (they should try something simpler first), that we don’t have the data to solve their problem (and how we might get it), or talking through potential solutions.”
Data Science is Multidisciplinary
Tags: datascience
Published: 2020-02-10 23:58:25

The Data Science field unifies skillsets across Computer Science, Mathematics, and Business Knowledge. The expectation is that using the scientific method of creating a hypothesis, analyzing structured and unstructured data, a data science team can produce useful insights. 

Skills include:
• Business Knowledge
• Data Mining / Preparing / Analyzing
• Software Development
• Machine Learning / Artificial Intelligence
• Data Visualization / Communication
Artificial Intelligence vs Machine Learning
Tags: ai, machinelearning
Published: 2020-02-11 00:00:13

Artificial Intelligence is a large field within the realm of data science. Machine Learning is a subset of AI. A basic understanding is that ML enables a system to learn new things from data. AI is a system that would then decide on what was learned. ML is simply a technique for realizing AI.

AI here is not what you’ve seen in movies, this is not a killer robot. There are 3 levels of AI.

**Artificial Narrow Intelligence** (ANI, aka weak AI or specific AI). This is the one-trick pony. It can do one task, such as AlphaGo, image recognition, diagnosing specific type of lung cancer.

**Artificial General Intelligence** (AGI, aka strong AI or full AI). This is human-level intelligence, like C3PO, or being able to hold a long conversation on philosophy.

**Artificial Super Intelligence** (ASI, aka ‘the singularity’). This is when the level of intelligence attained has allowed them to ‘runaway’ and continue evolving, like the robots in The Matrix or Terminator.
Windows does not remember git password
Tags: windows, git, ssh, shell
Published: 2020-02-12 00:27:36

---
title: Windows does not remember git password
published: true
date: 2020-02-11 00:00:00 UTC
tags: Windows, git, ssh,shell
canonical_url: 
---

Today I was writing a Windows batch script that would at some stage run `git pull`.

When I ran the script it paused and displayed the message:

`Enter passphrase for key: 'c/Users/Administrator/.ssh/id_rsa'`

![2020-02-11_09_22_25.png](https://solrevdev.com//media/2020-02-11_09_22_25.png)

No matter how many times I entered the passphrase Windows would not remember it and the prompt would appear again.

So, after some time on Google and some trial and error, I was able to fix the issue and so for anyone else that has the same issue or indeed for me from the future here are those steps.

**Enable the OpenSSH Authentication Agent service and make it start automatically.**

![2020-02-11_09_36_02.png](https://solrevdev.com//media/2020-02-11_09_36_02.png)

**Add your SSH key to the agent with `ssh-add` at `C:\Users\Administrator\.ssh`.**

![2020-02-11_09_37_39.png](https://solrevdev.com//media/2020-02-11_09_37_39.png)

**Test git integration by doing a `git pull` from the command line and enter the passphrase**

Enter your passphrase when asked during a `git pull` command.

**Add an environment variable for GIT\_SSH**

```
`setx GIT_SSH C:\Windows\System32\OpenSSH\ssh.exe`

```

![2020-02-11_09_41_45.png](https://solrevdev.com//media/2020-02-11_09_41_45.png)

Once these steps were done all was fine and no prompt came up again.

Success 🎉
The Lean Startup hands on, working backwards
Tags: agile, startup, productivity
Published: 2020-02-10 23:58:17

---
title: The Lean Startup hands on, working backwards 
published: true
description: Sometimes you have to work backwards to find out what you need to do.
tags: agile, startup, productivity
series: LeanStartup
---

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/e2n48zhnjkisynoblnyx.jpeg)

In [my previous post](https://dev.to/nicolasini/the-lean-startup-hands-on-1nbi) I gave a brief introduction to *The Lean Startup* and its **Build-Measure-Learn** feedback loop. I wen't on to describe how I started my first loop of the cycle and what came out of it. Now is time to start a new loop.

## What should I Build

The question that immediately comes to mind is: *What should I Build next?*. This is often not an easy question to answer, but there are things we can do to help us figure it out.

One useful approach is to look at the loop backwards and turn the question upside down: *What do I need to Learn?*

By framing the question this way we can focus on figuring out what do we need to know about our customers, our product, our service, etc. Once we have stablished what is the most important piece of information that we need to **Learn** we can start thinking about what do we need to **Measure** in order to fulfil that learning. And from there we can then specify what features or changes we need to **Build** into our product to achieve it.

## Putting it into practice

In my previous post I asked people to try my PoC (proof of concept) and tell me what they think of it in the comments section of the post.

This approach relies heavily in having others proactively telling me if they tried my product and what they thought of it. But it's hard to **Measure** any response against many who might try the product but not bother leaving a comment after.

So the question I want to **Learn** the answer to is: Are people trying my product?

A simple way to obtain data to **Measure** is to **Build** a basic visitor tracking feature. There are many options out there that can be used for this purpose, I have chosen to go with Mixpanel. The reason for it is that Mixpanel offers a free tier for low usage (even though is way higher that I could ever expect at this stage), and is very extensible and powerful for when the need arises for more.

## The waiting game

And now we wait. Hopefully people will visit the product, and I will get some basic information from my tracking efforts. With this information I would be able to answer a very simple question: Are people using the product at all?

## Try it out

So here it is: [DiBuJo](https://dibujo.now.sh/)

Give it a go, and let me know what you think of it in the comments section!
Open Source Code in the Workplace
Tags: webdev, opensource, discuss
Published: 2020-02-10 23:50:40

Every progressive developer comes across the same dilemma eventually:

> If we publish this package publicly, it can be maintained by the community but .. as a company, we don't want to have responsibility to maintain it.


It seems a little shameful really; sitting on a cloud of generosity, handing down packages to the lowly devs of the world but offering no support and expecting said lowly lackies to keep it alive while reaping the benefits.

But!
--------

It is a completely legitimate position. If you're in a small sweatshop agency, there's very little benefit and an awful lot of investment, so it is understandable most of the time.

So what do we do?
-----------------

Well, how about a compromise. If you find yourself about to create an abstract package that's just _crying out for open source publication_.. why not go ahead and do just that, but with your personal account.

Personal account!?
------------------

Okay, not necessarily. A personal work account perhaps but even so, if you're working on this invaluable positronic brain of a tool, perhaps in your spare time (being the good little socialist worker bee that you are, with an insatiable thirst for knowledge) why ever not?

But they won't like that!
-------------------------

Very possibly. IP is IP and if you're fiddling around during work hours, as it were, it won't go down well but there is a possible way around that..

Just tell me already!
---------------------

Set your company's open source account as a **collaborator**. Then, when you're at work, commit with that account, or better yet a personal work account. That way, the company has the power to deal life with one hand or death with another if they so choose but also you continue to build the thing as your own entity.  
Better yet, encourage your colleagues to get involved and maintain alongside yourself ' presenting your team to the world as a solid corpuscular body of pro-humanity development. Hench and awe-inspiring. Which looks good and feels good, just like.. _erm_.

Dream work makes the team work

Bit shady though, right?
------------------------

Nah, not at all. Consider the idea that you were two separate people: one employee, and one codey person-of-leisure. There'd be no conflict of interest there, so why not _flirt a little with splitting that personality_, because at the end of the day, you're both working toward the same goal and improving your skills doubly so (not to mention essentially doing out-of-hours work for free).

> Produce at work, perfect at home.

I agree
-------

I'm glad! But what do _you_ think? Are these just the feverish ramblings of a burnt-out engineer?
Show DEV.to: A time tracker that asks every 10 minutes what you're doing
Tags: showdev, productivity
Published: 2020-02-10 23:05:30

## What it is

[Maesure.com](https://maesure.com/?r=dt2) - can use it without signing up, though it's better to sign up.

Here's what it looks like when you use it for a while:

![What Maesure looks like when you're using the browser.](https://dev-to-uploads.s3.amazonaws.com/i/tba4ogq4tr620w182ii6.png)

## But why?

I tried a few ways to track time in the past using Excel spreadsheets and various apps. Usually I couldn't stand using it for more than a few days. Eventually I decided to try this approach &mdash; and surprisingly, it worked.

It's less annoying that it seems at first glance. The first few times the interruptions are a bit jarring, but once you get used to it, you mostly don't notice it anymore. After a day or so, you will be able to answer most of Maesure's popups with one click or two keystrokes because it will accumulate a list of your most recent answers.

## Who uses it

So far, it's been most popular among people who must track their time for work, either to bill clients or to report time on projects.

A few, including me, have used it to improve personal productivity. I've written about my approach [here](https://i-kh.net/2019/10/20/how-i-keep-the-side-project-moving/).

## Future plans

Eventually there will be a paid version, though that's still some time away. In the meantime, feel free to let me know what's working or not working for you - I try to respond quickly to the users 

Cheers and happy Maesuring!
Animated blocks, Swipeable gallery | Module Monday 72
Tags: showdev, githunt, webdev, javascript
Published: 2020-02-10 23:39:24

---
title: Animated blocks, Swipeable gallery | Module Monday 72
published: true
description: Module Monday 72
tags: showdev, githunt, webdev, javascript
cover_image: https://res.cloudinary.com/component/image/upload/b_rgb:ffffff,c_lpad,h_350,w_800/v1581313464/cards_zjakjy.gif
canonical_url: https://guide.anymod.com/module-monday/72.html
---

## Open source modules

Mods are modules that can be used on any website, web app, or anywhere else. There are hundreds more like these built & shared on [AnyMod](https://anymod.com).

Click a mod to see it along with its source code.

## Animated block cards
Full width cards that fade into focus when scrolled.
<a class="btn btn-sm" href="https://anymod.com/mod/animated-block-cards-aldadd?preview=true">View mod</a>
<a href="https://anymod.com/mod/animated-block-cards-aldadd?preview=true">
  <img src="https://res.cloudinary.com/component/image/upload/v1581313464/cards_zjakjy.gif"/>
</a>

## Swipeable gallery
Image gallery that works great on desktop or mobile.
<a class="btn btn-sm" href="https://anymod.com/mod/flickity-gallery-orrrrn?preview=true">View mod</a>
<a href="https://anymod.com/mod/flickity-gallery-orrrrn?preview=true">
  <img src="https://res.cloudinary.com/component/image/upload/v1581313466/flickity_ttzz3k.gif"/>
</a>

## Spatial hero
Themed intro section with prominent call to action button.
<a class="btn btn-sm" href="https://anymod.com/mod/hero-with-cta-raollr?preview=true">View mod</a>
<a href="https://anymod.com/mod/hero-with-cta-raollr?preview=true">
  <img src="https://res.cloudinary.com/component/image/upload/v1581313460/cta_gooxq0.png"/>
</a>

## Dual section highlights
Show off 2 cards and 2 actions.
<a class="btn btn-sm" href="https://anymod.com/mod/dual-section-images-mlarml?preview=true">View mod</a>
<a href="https://anymod.com/mod/dual-section-images-mlarml?preview=true">
  <img src="https://res.cloudinary.com/component/image/upload/v1581313459/dual_fwqccg.png"/>
</a>

## Dismissable message
Based on Bulma, this message does exactly what you want: gets out of the way once read.
<a class="btn btn-sm" href="https://anymod.com/mod/dismissable-message-raaakd?preview=true">View mod</a>
<a href="https://anymod.com/mod/dismissable-message-raaakd?preview=true">
  <img src="https://res.cloudinary.com/component/image/upload/v1581313458/dismissable_ymzoq8.gif"/>
</a>

<hr>

I post new mods from the community [here](https://dev.to/tyrw) every (Module) Monday -- I hope you find them useful!

Happy coding ✌️
Adonis.js - Advanced factories
Tags: node, adonisjs
Published: 2020-02-10 23:34:37

> Originally posted at [michaelzanggl.com](https://michaelzanggl.com/articles/adonisjs-advanced-factories). Subscribe to [my newsletter](https://michaelzanggl.com/) to never miss out on new content.

For a while now I have been using these little tricks to simplify writing factories.

## Nr. 1: override

Oftentimes you write a factory that requires a foreign key from another table like here:

```javascript
Factory.blueprint('App/Models/Subscription', async (faker, i, data) => {
  return {
    user_id: await Factory.model('App/Models/User').create().then(user => user.id),
    plan: 'monthly',
  }
})
```

But sometimes you already have a user and don't want to create a new one, so you need to add some logic to your blueprint

```javascript
Factory.blueprint('App/Models/Subscription', async (faker, i, data = {}) => {
  return {
    user_id: data.user_id || await Factory.model('App/Models/User').create().then(user => user.id),
    plan: 'monthly',
  }
})
```

and then call it like this

```javascript
Factory.model('App/Models/Subscription', { user_id: 1 })
```

Having to do this repeatedly can get quite cumbersome, because you have to write a lot of it for your tests. I have created this little "magic" method that automates this for you: [https://github.com/MZanggl/adonis-override-factory](https://github.com/MZanggl/adonis-override-factory).

Our blueprint from before now becomes

```javascript
Factory.blueprint('App/Models/Subscription', async (faker, i, data) => {
  return override({
    user_id: () => Factory.model('App/Models/User').create(),
    plan: 'monthly',
  }, data)
})
```

Note how the default data is now wrapped inside the "override" method. The "Factory...create()" is also wrapped in a higher-order function to avoid executing it when data was passed.

Finally, there is no need for `.then(user => user.id)` because the "override" method resolves the id automatically when it receives an object.

## Nr 2: 'Factory.model' => 'factory'

Inside `vowfile.js` where you set up the test environment I have added this little global helper:

```javascript
const Factory = use('Factory')

global.factory = (model) => {
    return Factory.model(model)
}
```

So instead of writing

```javascript
const Factory = use('Factory')
Factory.model('App/Models/User').create()
```

we can now do

```javascript
factory('App/Models/User').create()
```

It's again a way to save some keystrokes. While globals are considered harmful, there are some use cases and there is no problem to [use globals when the price is right](https://www.youtube.com/watch?v=lEUkarkROv0&list=PL9wALaIpe0Py6E_oHCgTrD6FvFETwJLlx&index=4).

---

I like to make not too many modifications to the framework as it can make upgrading more difficult and the project becomes more custom in general, so I try to keep such things to a minimum and only apply them after a long trial period with the things the framework provides by default.
Refactor Common CLI Tools
Published: 2022-12-09 14:09:03

---
title: Refactor Common CLI Tools
published: true
date: 2020-02-10 23:22:19 UTC
tags: 
canonical_url: https://blog.niradler.com/refactor-common-cli-tools
---

All of us command line fans have our common CLI tools ready for tasks such as `jq` for JSON manipulation and curl for creating HTTP requests.

I decided to revisit these tools and refactor them to check if I can make them more flexible and easy to use basically to make them a bit more modern.

These is the tools I created:  
1. [json-cli-tool](https://www.npmjs.com/package/json-cli-tool) - Manipulate JSON.  
2. [loop-pipe](https://www.npmjs.com/package/loop-pipe) - Loop over piped data.  
3. [transform-cli](https://www.npmjs.com/package/transform-cli) - Transform data types for now just from and to base64.  
\* just to mention [github-kit-cli](https://www.npmjs.com/package/github-kit-cli) this is the gkc in the example until Github will finish GitHub CLI this is my solution.

Let's look at this example, this commands going to log the content of the readme file from my GitHub repos.

```
gkc search repos -p="q=org:niradler" | jc --p="items" --fm="name" --o="newline" | lp "gkc repos getContents -p=\"owner=niradler&repo={v}&path=README.md\" | jc --p=\"content\" | tc --ft=\"base64\" --tt=\"txt\""

```

or the longer version

```
gkc search repos --params="q=org:niradler" | jc --path="items" --flatMap="name" --output="newline" | lp "gkc repos getContents --params=\"owner=niradler&repo={v}&path=README.md\" | jc --path=\"content\" | tc --fromType=\"base64\" --toType=\"txt\""

```

Let's break this down:  
1. query Github API to get my repos names. (gkc)  
2. manipulate JSON response to a flattering list. (jc)  
3. loop over the list of repos and run commands for each repo. (lp)

These tools will probably not replace `jq`, `sed`, `xargs` and others but I find them easier to use so I can save these big guns for more heavy duty.

This is just a POC to test if this path is even a thing, do I really want to refactor amazing tools that have been battle tests? not sure about this, but for now I'm enjoying the easy usage, and testing new capabilities.
Stop procrastinating and do the thing!
Tags: uwp, csharp, github, visualstudio
Published: 2020-02-10 23:17:51

Ok Rob, it looks good enough.  

There is no way to put it off any longer.

STOP MAKING IT PRETTY AND ADD THE AUTHENTICATION CODE!

![prototype of Aurora but no OAuth yet](https://i.pinimg.com/originals/50/5f/61/505f617f0aebb85c27ce96f2fe8074bf.gif)
Fastest Way to Generate Random Strings in JavaScript
Tags: javascript, showdev
Published: 2020-02-10 22:24:33

There are so many ways to generate random strings in JavaScript and it doesn't really matter which method is faster. 

The method I like using most is `Math.random()`

I made a video on it:

{% youtube 9O-SLMn5m6c %}

Basically the idea is to use `Math.random()`, then you can convert it to string and do some simple string manipulation on it.

To get random numbers, I would use something like below:

```js
Math.ceil(Math.random()*10000)
```

To get random strings with numbers only, I would use:

```js
Math.random().toString().substr(2, 5)
```

Fortunate `.toString()` has a param called `radix` that you can pass in numbers between `2 - 36` which will cast the generated numbers to the radix characters that fall between the given number. The `radix` is also known as `base` and its for representing numeric values

To get a random number between 0-1:

```js
Math.random().toString(2).substr(2, 5)
```

To get a random number between 0-5:

```js
Math.random().toString(5).substr(2, 5)
```

Starting from 11/12, it will start introducing letters. So to get a fully random string:

```js
Math.random().toString(20).substr(2, 6)
```

With this you can now write your awesome random string generator:


```js
const generateRandomString = function(){
return Math.random().toString(20).substr(2, 6)
}
```

To be able to change the length of the output:


```js
const generateRandomString = function(length=6){
return Math.random().toString(20).substr(2, length)
}
```

One liner

```js
const generateRandomString = (length=6)=>Math.random().toString(20).substr(2, length)
```
That's all.

If you know of any other faster ways, please I would love to see it in the comment section.

Thanks