teleren/devto huggingface dataset:
Copying a git repository properly
Tags: git, github, todayilearned
Published: 2020-03-31 11:03:20

G'day Internet.

Two weeks ago my company migrated from Github Entreprise to Github Enterprise Cloud. All the migration went well. Only today I realised that two of my private repositories were not migrated. Luckily enough a colleague of mine pointed me towards a solution (thanks Dario). And here I share this solution with you.

Making a simple copy of the repository and pushing it to a new repository in the cloud was a solution, but not a good one. Why? Because all the history of the repository is lost. Our solution does not only copy the codebase, but also the history.

First we want to retrieve the old repository. In a terminal, run the following command.

```zsh
λ git clone --mirror git@company.com/repository.git
```

Note the [--mirror](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---mirror) option: it creates a `repository.git` folder with both the codebase and the history.

Before running the next commands, we need to create an empty repository in github cloud. If you wanted to change the name of you repository, now is a good time. For this example we will keep the name `repository`.

Once it is create run the following commands

```zsh
λ cd repository.git
λ git push --mirror git@github.com:company/repository.git
```

We should now be able to see our repository in github cloud populated with the codebase and the history. 

When pushing to the new repo we could encounter the following error
```
! [remote rejected] refs/pull/1/head -> refs/pull/1/head (deny updating a hidden ref)
```
This is likely because a [pull request was opened](https://stackoverflow.com/a/34266401) in the previous repository. It does not stop the repository being copied, it just does not copy the pull request.

That's all folks, I hope this helps.

Jon
How to add URL in Botman button in web-driver
Tags: botman
Published: 2020-03-31 12:17:12

Hello,

I want to add a URL in Botman button during conversation.

Where I want to when we click on the answer button it's should be redirect to a URL in a new tab.

I use ButtonTemplate but it's work on facebook messenger but I want to use it with simple web-driver where it's shown on browser.

Please help.

Code is given below.

<?php
namespace App\Http\Conversations;
use BotMan\BotMan\Messages\Incoming\Answer;
use BotMan\BotMan\Messages\Outgoing\Question;
use BotMan\BotMan\Messages\Outgoing\Actions\Button;
use BotMan\BotMan\Messages\Conversations\Conversation;

class SelectServiceConversation extends Conversation
{
    public function askService()
    {
$question = Question::create('What kind of Service you are looking for?')
            ->callbackId('select_service')
            ->addButtons([
                Button::create('Mobile')->value('Mobile'), // Here we want to add URL which should be redirect on new page after click

                Button::create('Charger')->value('Mobile'),
                Button::create('Battery')->value('Mobile'),
            ]);

        $this->ask($question, function(Answer $answer) {
            if ($answer->isInteractiveMessageReply()) {
                $this->bot->userStorage()->save([
                    'service' => $answer->getValue(),
                ]);
            }
	    $this->bot->startConversation(new NextConversation()); // Trigger the next conversation
        });  

    }

    public function run()
    {
        $this->askService();
    }
}
Collaboration Software Startup Clubhouse Grows 233% In Six Months
Tags: softwareengineering, startup, engineering, darrenhuston
Published: 2020-03-31 12:16:53

Clubhouse, which bills itself as "the collaborative home for modern software teams", reports that it has grown from 30,000 registered users to over 100,000 since September 2019.

In a field awash with alternatives like Asana, Jira, and Trello, Clubhouse has decided to focus on building a fast tool that works well for product and engineering teams in high-growth companies. The focus is clearly paying off as customers switch from other tools after trying Clubhouse.

“We made a bet on building an easy-to-use, fast, and powerful platform that enables modern software teams and their collaborators to do their best work, while still being a joy to use,” said Kurt Schrader, co-founder and CEO of Clubhouse. So far, the approach seems to be paying off.

Read Full Article @ https://www.forbes.com/sites/justinwarren/2020/03/30/collaboration-software-startup-clubhouse-grows-233-in-six-months/#53ba8f097ae4
My #100daysofcode challenge so far
Tags: 100daysofcode
Published: 2020-03-31 12:14:22

Hello:wave:
So on 20th March 2020, I committed to doing [Alexander Kallaway's](https://www.100daysofcode.com/) #100days of code challenge and let's be honest, I'm tired:tired_face::sleeping::joy:.
![alt text](https://images.unsplash.com/photo-1502106386062-9bc912245fce?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80 "Photo by Milada Vigerova on Unsplash")
                *Photo by Milada Vigerova on Unsplash*


**What I've been doing**
[Wikipedia Viewer](https://giddy-mangrove-thunbergia.glitch.me/) *from freecodecamp take-home projects.*
[Local Weather App](https://closed-luminous-neighborhood.glitch.me/) *also from freecodecamp take-home projects.*
[The Odin Project](https://www.theodinproject.com/tracks/2) *FullStack JavaScript track*

**Resources I'm finding useful**
- [Freecodecamp](https://www.freecodecamp.org/) Learn to code with free 
  online courses, programming projects, and interview preparation for 
  developer jobs.
- [The Odin Project](https://www.theodinproject.com/) *A web development 
  website with different tracks to follow.*
- [30 seconds of code](https://www.30secondsofcode.org/) *Short JavaScript 
  code snippets that can be understood in less than 30 seconds.*
- [Tomato Timer](https://tomato-timer.com/) *A pomodoro clock I'm using to 
  time myself and take breaks when necessary.*

**My Key Takeaways**
- Giving up is not an option. You'll feel like it but just don't do it.
- Pace yourself, it's not a sprint.
- Plan ahead. Without planning you end up stranded and wasting a lot of 
  time deciding on what to do.

*In conclusion, Have fun with the challenge:dancer::dancer:, your mental health is just as important.*
The Life Of A Non-Profit Data Professional - Episode 126
Published: 2020-03-31 11:56:39

<p>Building and maintaining a system that integrates and analyzes all of the data for your organization is a complex endeavor. Operating on a shoe-string budget makes it even more challenging. In this episode Tyler Colby shares his experiences working as a data professional in the non-profit sector. From managing Salesforce data models to wrangling a multitude of data sources and compliance challenges, he describes the biggest challenges that he is facing.</p><p><a href='https://www.dataengineeringpodcast.com/non-profit-data-engineering-episode-126/'>Listen Now!</a></p>
Does Changing a Username or Organisation Name Provide Redirects?
Tags: askdev, help, meta
Published: 2020-03-31 12:09:05

---
title: Does Changing a Username or Organisation Name Provide Redirects?
published: true
description: Does Changing a Username or Organisation Name in Dev.to Provide Redirects?
tags: askdev,help,meta
---

Can someone help answer the question?

Does changing a Username or Organisation name in Dev.to provide redirects from old post URLs to the new ones? 

Or, do the URLs stay as they were at the time the post is published?
Sliding Window Technique + 4 Questions (Algorithms Series)
Tags: slidingwindow, dynamicprogramming, algorithms
Published: 2020-03-31 12:03:06

Sliding Window Technique is a method for finding subarrays in an array that satisfy given conditions. We do this via maintaining a subset of items as our window, and resize and move that window within the larger list until we find a solution. Sliding Window Technique is a subset of Dynamic Programming, and it frequently appears in algorithm interviews. In this video, you will learn how Sliding Window Technique works (with animations), tips and tricks of using it, along with its applications on some sample questions.

Video: https://www.youtube.com/watch?v=jM2dhDPYMQM
Article: http://quanticdev.com/algorithms/dynamic-programming/sliding-window

In the video, you will find the solutions to the following questions, as well as their time and space complexities:

• Easy: Statically Sized Sliding Window: Given an array of integers, find maximum/minimum sum subarray of the required size.
• Medium: Dynamically Sized Sliding Window: Given an array of positive integers, find the subarrays that add up to a given number.
  o Variation (Medium): Same question but for an array with all integers (positive, 0, negative). The optimal solution is Kadane's Algorithm, but Sliding Window can still be applied with modifications (not recommended though).
• Medium: Flipping/Swapping: Given an array of 0's and 1's, find the maximum sequence of continuous 1's that can be formed by flipping at-most k 0's to 1's.
• Hard: Strings: Given a string and n characters, find the shortest substring that contains all the desired characters.
Daily Developer Jokes - Tuesday, Mar 31, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-03-31 12:00:23

---
title: "Daily Developer Jokes - Tuesday, Mar 31, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Tuesday%2C%20Mar%2031%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258eb1a429.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Why was the developer's family upset with them at dinner?

___A:___ They forgot to git squash before going home
 -->
Free data COVID-19 web service
Tags: covid19, coronavirus, webservice, opensource
Published: 2020-03-31 11:51:32

---
title: Free data COVID-19 web service
published: true
description: web service to deliver covid-19 applications
tags: covid-19, coronavirus, web service, open source 
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/kld34rlfuecdnn95zy0j.png
---
Take advantage of this web service to deliver covid-19 applications and help people track informations in real time.
In this link https://coronavirus-resources.esri.com/datasets/bbb2e4f589ba40d692fab712ae37b9ac_1/geoservice?geometry=33.831%2C-38.069%2C-16.443%2C63.033&orderBy=Country_Region&page=8 you will find an API explorer to get what you need of JSON formatted open source data : Confirmed Cases, Recovered Cases, geolocation.. to consume and help your country or continent.

For the doubtful, These data are official and reliable because they are screened from official sources.

enjoy and share!
Why Your npm link Commands Might Be Failing
Tags: npm, nvm
Published: 2020-05-08 13:48:51

---
title: Why Your npm link Commands Might Be Failing
published: true
date: 2020-03-31 11:43:00 UTC
tags: npm, nvm
canonical_url: https://rubensbits.co/posts/why-your-npm-link-commands-might-be-failing
---

* * *
 ![npm](https://rubensbits.co/media/npm.png)
# Problem

### Summary

When you try to use `npm link` to install a dependency you’re working on locally, the changes aren’t reflected in your project.

You also see intermittent issues starting your project (esp. in TypeScript), as well as subdependencies not resolving correctly.

# Solution

### Summary

There are two issues you can run into when `npm link` isn’t working which are worth noting;

1. nvm related issues
2. Peer Dependency related issues

#### nvm

`nvm`, or Node Version Manager, is a tool used to run different versions of node locally across microservices at the same time.

When running `npm link`, the specific version of node being used in the project will be used to create the link, which means only projects using the same version of node will be able to access the local version of the dependency. This can be all the more frustrating because npm link doesn’t throw an error when this happens.

Here’s the readout when using different versions of node (one using `8.9.4`, the other using `12.13.1`):

```
/Users/myName/dev/_github/myRepo/node_modules/myDependency ->
/Users/myName/.nvm/versions/node/v12.13.1/lib/node_modules/myDependency
```

And here’s the readout with the same version of node (both using `8.9.4`):

```
/Users/myName/dev/_github/myRepo/node_modules/myDependency ->
/Users/myName/.nvm/versions/node/v8.9.4/lib/node_modules/myDependency ->
/Users/myName/dev/_github/myDependency
```

Notice how the bottom line resolves to a folder where the dependency resides locally.

To fix this, use `node -v` in each project and check the running version of node. Use `nvm install x.x.x` & `nvm use x.x.x` to match them up.

Afterward, delete your `node_modules`, delete your `package-lock.json`, re-run `npm i`, and re-run `npm link` in your dependency folder and `npm link myDependency` in your project folder.

That should help.

#### Peer Dependencies

If your dependency has references to `peerDependencies` in it’s `package.json` you could stumble into issues with symlinks. These manifest themselves in the form of the peerDependency being unablee to be resolved at either compile time or at run time when needed.

The fix for this relatively simple. Add `--preserve-symlinks` into your start script e.g. `node --preserve-symlinks build`.

This will instruct your startup script to look in the correct place for it’s peer dependencies when running locally. Note that you’ll want to remove the flag once you’re done testing locally.

* * *

# Problem (Hopefully) Solved

If you have any questions you’d like to ask me about this post, feel free to reach me on [Twitter](https://twitter.com/rubengmurray) or [Github](https://github.com/rubengmurray).
Django Rest Framework: How to let user add only one ForeignKey object (for example review)
Tags: django, python
Published: 2020-03-31 11:37:59

When building my API that would list places (that offer products) and users can rate both places and products I needed a way to limit user to one review per place and one review per product.

_I couldn't find any solution online so I came up with my own. If you know better way, please let me know down in the comments. Thanks!_

This problem likely should be handled on database level (or rather ORM) level but I wanted to explore Django Rest Framework so I created validation in the serializer.

You can implement `validate` method on your serializer to validate the data. With this I faced issues with not having all the available data available for validation. Turns out, you can provide additional context for your serializer inside view with `get_serializer_context`.

I used this method to add `product_id` and the `request` itself to the context for use in `validate` method like so:

```python
def get_serializer_context(self):
    return {'product_id': self.kwargs['product_id'], 'request': self.request}

```

With this ready, the `validate` method can be implemented:

```python
def validate(self, data):
    product_id = self.context["product_id"]
    if Review.objects.filter(product_id=product_id, author=self.context["request"].user).exists():
        raise serializers.ValidationError("This user has already added review for this product")
    return data
```

I first get `product_id` from the `context` and then check whether `Review` object for this product exists by this user which I can get from `request`. If it does, we can `raise` `ValidationError` and explain what is wrong.

Users can still add reviews but in case they decide to add another, the `validate` method will prevent them from doing so.

This particular API is for mobile app which would do this validation on its part. AKA when user enters reviews section for product/place it would already load this user's review and display it for possible edit. So the above is more like additional check to prevent unwanted data in the database.

_Thanks for reading! And do let me know if you have better solution._
Command Line to List Size of Directory (MacOS/Linux)
Tags: misc, linux, shell
Published: 2020-04-03 06:10:44

---
title: Command Line to List Size of Directory (MacOS/Linux)
published: true
date: 2020-03-31 11:33:00 UTC
tags: Misc,Linux,Shell
canonical_url: https://coderscat.com/command-line-to-list-size-of-directory-macos-linux
---

![2020_03_31_command-to-list-size-of-directory.org_20200331_194953.png](https://coderscat.com/wp-content/uploads/2020_03_31_command-to-list-size-of-directory.org_20200331_194953.png)

I found the command `du` is different on Mac compared with Linux. A little bit of confusion.

Here is a note how to use `du` on different OS.

## du on Mac

List the size of current directory, the option **-h** is displaying in human friendly format, the option **-s** is not recursive to display all sub-directories:

```bash
du -hs .
```

List all the size of sub-directories in current directory:

```bash
find . -maxdepth 1 -mindepth 1 -type d -exec du -hs {} \;
```

If you want to sort according to the size, use pipeline and sort:

```bash
find . -maxdepth 1 -mindepth 1 -type d | xargs du -hs | sort -hr
```

If you want to know which directory cost most disk space, another handy util command line is `ncdu`. You could install it via homebrew:

```bash
brew install ncdu

# Run in the specific directory
ncdu
```

The result is like this:

![2020_03_31_command-to-list-size-of-directory.org_20200331_194324.png](https://coderscat.com/wp-content/uploads/2020_03_31_command-to-list-size-of-directory.org_20200331_194324.png)

## du on Linux

Linux du have the option –max-depth to limit the depth:

```bash
du -h --max-depth=1 | sort -hr
```

The post [Command Line to List Size of Directory (MacOS/Linux)](https://coderscat.com/command-line-to-list-size-of-directory-macos-linux) appeared first on [Coder's Cat](https://coderscat.com).
Emerging Digital Academy Becomes North Dakota’s First Authorized Software Engineering Bootcamp
Tags: engineering, softwareengineering, darrenhuston, digitalacademy
Published: 2020-03-31 11:29:15

North Dakota’s State Board for Career and Technical Education has authorized the operating license for Emerging Prairie’s Emerging Digital Academy–making it North Dakota’s first authorized coding academy. 

Emerging Prairie Co-Founder and Executive Director, Greg Tehven, shares the impact this will have for our entire region: “This is a game-changer for North Dakota. Established companies and early-stage companies all need talent and have struggled to find enough software engineering candidates.” Tehven added, “We couldn’t have done this without strong support from our Advisory Board, led by Byron Snider, and from our Founding Partners–which include Bushel, Microsoft, Scheels, OnSharp and Sycorr.” Also providing support for the academy are AT&T, Codelation, Stoneridge Software, and Network Center. 

Emerging Digital Academy’s Director, Blaine Booher, worked daily to ensure the licensure was in place before students were officially enrolled or before classes started. “Being the first program of this kind in North Dakota, ongoing communication was needed to make this happen. The team at North Dakota’s Department of Career and Technical Education were great about giving us the guidance needed to reach this important milestone in the best interest of students.” 

Read Full Article @ https://fargounderground.com/emerging-digital-academy-becomes-north-dakotas-first-authorized-software-engineering-bootcamp/
Quick Python: Unit Testing
Tags: python, testing
Published: 2023-01-06 01:33:27

---
title: Quick Python: Unit Testing
published: true
date: 2020-03-31 11:27:47 UTC
tags: Python,Testing
canonical_url: https://brandonrozek.com/blog/pyunittest/
---

Python has a great built-in [unit test](https://docs.python.org/3.7/library/unittest.html) framework. This post will give a skeleton for how to format the files in your `tests` directory.

Example `tests/test_basic.py`

```
import unittest

class Tester(unittest.TestCase):
    def setUp(self):
        """To Run Before Every Test Case"""
        pass

    def tearDown(self):
        """To Run After Every Test Case"""
        pass

    def test_something(self):
        """A Test Case"""
        self.assertEqual(True, True)

if __name__ == ' __main__':
    unittest.main()

```

To auto-discover and run your tests

```
python -m unittest discover -s tests

```
Volunteer Programmer Needed - CodeMason
Published: 2020-03-31 11:22:30


We are seeking volunteer developers who are experienced to help us develop our upcoming wallet and block explorer. Some volunteer programmers who developed the applications originally are influenced by the virus, but we still need to keep up to the pace.

All of the volunteers will be rewarded with our tokens as well as honour rewards.

Please contact us to learn more about us and the volunteer role. 
Email: codemasonmining@protonmail.com
Go Micro v2.4.0 release is out!
Tags: go, programming
Published: 2020-03-31 11:18:25

---
title: Go Micro v2.4.0 release is out!
published: true
description: The Go microservices development framework
tags: golang, programming, open source
---

The Go Micro 2.4.0 release is out! Enjoy!

https://github.com/micro/go-micro/releases/tag/v2.4.0
Traveling the World Virtually
Tags: fun, image, video
Published: 2020-04-02 07:04:40

---
title: Traveling the World Virtually
published: true
date: 2020-03-31 10:52:26 UTC
tags: fun,image,Video
canonical_url: https://dougsillars.com/2020/03/31/traveling-the-world-virtually/
---

It is the the end of March, 2020.  Spring is in the air, but much of the world is in self-isolation or lockdown from the global pandemic of coronavirus. My family and I are in Zagreb, Croatia and we are safe. However, our plan of spending the next month exploring the country of Croatia has … [Continue reading Traveling the World Virtually](https://dougsillars.com/2020/03/31/traveling-the-world-virtually/)
Free hosting for Open Source projects
Tags: hosting, aws, heroku
Published: 2020-03-31 10:48:13

[Qovery](https://www.qovery.com) combines the power of Kubernetes, the reliability of AWS and the simplicity of Heroku to deploy modern application seamlessly!

I am pleased to announce that Qovery supports individual developers / open source and non profit projects to **host up to 3 applications (database included) for free**. Our business model is based on Enterprise hosting, which gives us the possibility to offer generous free plans.

[Start using Qovery now](https://www.qovery.com) and [join the community](https://discord.qovery.com)!
Looking for an open-source flipbook library
Tags: opensource, flipbook, javascript
Published: 2020-03-31 10:46:01

---
title: Looking for an open-source flipbook library
published: true
description: Looking for an open-source alternative to ISSUU for digital publishing of PDFs
tags: open-source, flipbook, js
---

I am looking for an open-source JS library to create a similar flipbook effect like (for example) ISSUU does, for digital publishing. After many googling attempts I haven't found a library that I can simply feed with a PDF file and generate this flipbook effect.

The most interesting was http://www.turnjs.com, but the book needs to be in HTML5, not PDF...

Do you know any by chance? Thanks!