teleren/devto huggingface dataset:
2 Critical Python packaging tools
Tags: python, packaging, tox, twine
Published: 2020-01-01 18:02:50

At last week's [Python Frederick](https://www.meetup.com/python-frederick/) meetup, I gave a talk on Python packaging.  My aim was to cover how packaging works and how to build a basic package.  Over the course of the talk, we used a couple of tools that I think are critical for releasing a Python package to PyPI.  *I'll describe these tools and why I think they are critical*.

## tox

[tox](https://tox.readthedocs.io/en/latest/) is a fantastic tool for *testing packaging*.  With the `tox` command, a developer can build a package, install it into a virtual environment for a specific Python version, and run the package through its test suite.

The short version of running tox looks like:

```bash
$ tox -e py36
```

This command will run a package's test suite against Python 3.6.  I love it when commands are that elegant.  To make that possible, the developer must tell tox how to run the test suite.  This configuration is done in a `tox.ini` file.  A minimal file could look like:

```ini
[tox]
envlist = py36

[testenv]
commands = python -m unittest discover \
    -s {envsitepackagesdir}/whirlygig
```

In this example, you would change `whirlygig` to the name of your project.  This is enough information to inform tox about how to run your test suite.

I find that using tox saves me from hard to catch packaging bugs (did you know those exist?) and is generally awesome for testing against multiple versions of Python.

## twine

[twine](https://pypi.python.org/pypi/twine) is a critical tool in a packager's toolbelt for one reason: *it let's you upload to PyPI over HTTPS*.  In contrast, `python setup.py upload` uses insecure HTTP for many versions of Python.

Even though it seems silly, you need a separate package to upload securely over HTTPS.  I presume there are good reasons for that requirement that I'm unaware of.

`python setup.py sdist bdist_wheel` creates a `dist` directory with the packages to upload.  You can perform your upload with:

```bash
$ twine upload dist/*
```

## Summary

The Python ecosystem has excellent documentation about packaging at the [Python Packaging User Guide](https://packaging.python.org/).  This post was meant to be a gentle introduction to a couple of very valuable tools when you want to work with packages.

(Yes, I know a "package" is technically called a "distribution" in proper Python lingo, but I used the term as it is more broadly accepted among many programming languages.)

This article first appeared on [mattlayman.com](https://www.mattlayman.com/blog/2017/2-critical-python-packaging-tools/).
Should Age be a problem? The Truth about Learning to Code Later in Life
Tags: general, latestposts, 100daysofcode, amitoooldtocode
Published: 2020-01-01 23:12:51

---
title: Should Age be a problem? The Truth about Learning to Code Later in Life
published: true
date: 2020-01-01 18:00:00 UTC
tags: General,Latest Posts,100 days of code,am i too old to code
canonical_url: http://robdoylecreative.com/should-age-be-a-problem-the-truth-about-learning-to-code-later-in-life/
---

So I’ve been looking at a lot of blog, forum and social media posts lately and seeing many people talking about learning to code in their 30s, 40s and 50s and beyond. These people are looking for support but often are met with negative comments saying that they shouldn’t bother or they are too old.  […]

The post [Should Age be a problem? The Truth about Learning to Code Later in Life](http://robdoylecreative.com/should-age-be-a-problem-the-truth-about-learning-to-code-later-in-life/) appeared first on [Rob Doyle Creative](http://robdoylecreative.com).
Volta in Docker
Tags: volta, docker, node
Published: 2020-01-01 17:05:38

[Volta homepage](https://volta.sh/) says: "The JavaScript Launcher ⚡". What it does for me is:

1. Have multiple `node` and `yarn` versions installed side by side
1. Switch between individual `node` and `yarn` versions seamlessly (`cd` into the directory containing `package.json` is enough)
1. Make sure that everyone in the team uses the same version of `node` and `yarn`
1. Globally install `node` modules

## How to volta

Install: 

```sh
curl https://get.volta.sh | bash
volta install node
## That's it!
```

Pin `node` and `yarn` versions in your project:

```sh
cd my-project
volta pin node@10.18.0; volta pin yarn@1.21.1
```

Now you will have the respective versions of `node` and `yarn` available every time you enter the `my-project` directory.

## Volta in Docker

The problem with `Docker` is that `volta` relies on sourcing the scripts stored `~/.bashrc`. You could in theory prepend every "`node` command" with `source ~/.bashrc &&` or something, but that's not very practical. Following example `Dockerfile` shows my solution with explanation on individual lines:

```docker
FROM debian:stable-slim
WORKDIR /myapp/

# curl and ca-certificates are needed for volta installation
RUN apt-get update \
  && apt-get install -y \
  curl \
  ca-certificates \
  --no-install-recommends

# bash will load volta() function via .bashrc 
# using $VOLTA_HOME/load.sh
SHELL ["/bin/bash", "-c"]

# since we're starting non-interactive shell, 
# we wil need to tell bash to load .bashrc manually
ENV BASH_ENV ~/.bashrc
# needed by volta() function
ENV VOLTA_HOME /root/.volta
# make sure packages managed by volta will be in PATH
ENV PATH $VOLTA_HOME/bin:$PATH

# install volta
RUN curl https://get.volta.sh | bash
RUN volta install node

# test whether global installation of packages works
RUN volta install ember-cli

# test that volta manages node/yarn version
COPY index.js package.json yarn.lock /myapp/
RUN yarn --pure-lockfile
```

Now let's have `package.json`:
```json
{
  "name": "volta-in-docker-example",
  "volta": {
    "node": "10.17.0",
    "yarn": "1.20.0"
  }
}
```

If you build such `Docker` container:

```sh
docker image build -t volta:0.0.1 -f volta.Dockerfile .
```

And then check the node version installed, you should get whatever was specified in `package.json`:
```sh
docker container run --rm --name volta volta:0.0.1 node --version
# v10.17.0
```

## The why

One could put `FROM node:10.17.0` directly into the `Dockerfile`. But:

1. One might not want to run `node` projects *locally* in a container, thus there will be a need to sync the versions
1. Dev environment synchronisation is hard & important & *hard*
1. `yarn` versions should also be in sync to prevent possible (real) problems
My CSS plans for 2020
Tags: css
Published: 2020-01-01 17:17:03

CSS, to me; is way more difficult than frontend or backend coding. This is exactly why frameworks such as Bootstap are so popular.

Major corporate websites don't use Bootstrap, they prefer SCSS and plain old CSS. 

Now that we have the wonderful HTML Grid, we have the ability to create layouts that just work.

**2020 CSS Goals**

1. Focusing on the HTML grid is my priority for all layout. Do we need anything else?

2. I will continually put each layout solution into my own personal toolbox. Simply done by keeping them in one place. 

3. I will continue using Angular components as a way to deliver toolbox styles. all based on the grid.

Over time, the chances of the toolbox having something needed for the job increase, perhaps even exponentially. I fully expect to have a robust layout toolbox in 4 months or less.

JWP2020
Top 5 JavaScript Frameworks to learn in 2020
Tags: javascript, react, vue, angular
Published: 2020-01-01 17:11:21

I just published an article on dunebook Featuring Top 5 JavaScript Framework to learn in 2020.

You can Read Complete article here - [Top JavaScript Framework 2020](https://www.dunebook.com/top-5-javascript-frameworks-to-learn-in-2020/) for pros and cons including Real-time Github Stats, But Here I will share some insights and All listings from the article.

In this article, our main focus will be only on JavaScript Frameworks in 2020 and a library that has a Framework ecosystem.

## 1. Vue
Vue is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

Moreover, Vue is a Simple, minimal core with an incrementally adoptable stack that can handle apps of any scale.

## 2. React

React is a declarative, efficient, and flexible JavaScript library with a framework Ecosystem, React is based on the concept of DOM manipulation is a costly operation and ought to be minimized.

## 3. Angular

Angular is a Typescript (Superset of JavaScript) framework that you can use to build a large scale single page web applications.

Angular comes with most everything you need to get some web development done.


## 4. Svelte

Svelte is a modern JavaScript framework that allows you to write easy-to-understand JavaScript code that is then compiled to highly efficient code that runs in the browser.

The framework is similar to React or Vue, but in Svelte, we don’t have any dependencies. That means it will not take any time to interpret our code, so we will get pure JavaScript before runtime.

##5. Ember

Ember.js is a JavaScript framework that greatly reduces the time, effort and resources needed to build any web application.

### Conclusion

You can surely use any JavaScript library or framework of your preference, but the best choice will facilitate your work a lot.

Read Complete article on [Dunebook.com](https://www.dunebook.com/top-5-javascript-frameworks-to-learn-in-2020/)
Image Handling in React Native
Tags: discuss, reactnative
Published: 2020-01-01 16:27:50

Hey everyone,

I'm working on a react native project that involves users uploading images from their devices. Got it up and running, and successfully uploading to Firebase Cloud Storage and I now want to implement some client side image handling.

I know I'd like to limit the size of the image, and I'll most likely implement it client side.

Have any tips or best practices for image handling in general, or react native implementations?
Column-like layout in CSS without Bootstrap or Grids (Part-2) 
Tags: html, css, layouts
Published: 2020-01-01 16:15:38

Another great way to to design our text into columns is going to back to the old ways of building websites. If you remember correctly, primitive websites were all just *tables* tweaked in different ways.

Well that's great because we can use just that to quickly place our texts in different columns . As always I would like to illustrate it with an example.

Let's first create an html skeleton of our texts

```
<section id="exhibit">
 
 <div class="col">
 Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 Vivamus porta massa eget pellentesque aliquam. Ut malesuada 
 sapien aliquam, 
 pharetra metus quis, finibus dui. 
 Curabitur fermentum ac leo non consectetur. 
 </div>
  

 <div class="col">
 Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 Vivamus porta massa eget pellentesque aliquam. Ut malesuada 
 sapien aliquam, 
 pharetra metus quis, finibus dui. 
 Curabitur fermentum ac leo non consectetur. 
 </div>


 <div class="col">
 Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 Vivamus porta massa eget pellentesque aliquam. Ut malesuada 
 sapien aliquam, 
 pharetra metus quis, finibus dui. 
 Curabitur fermentum ac leo non consectetur. 
 </div>

```

Then the CSS styling would be like this
```
#exhibit{
    height: 500px;
    display: table;
    width: 100%;
   }
.col{
    padding-left: 2em;
    padding-right: 2em;
    font-size: 1.2em;
    font-family: sans-serif;
    overflow: hidden;
    display: table-cell;
    background: grey;
   }
```
So we would like to lay these 3 divs as three separate columns. If you read the code, you would see the divs are wrapped in a `section`. 

We set this parent/ wrapper to `display: table` . Then if we set its children to `display: table-cell` we would see them lined up in 3 columns.

The final output would look something like this

{% codepen https://codepen.io/Silver1/pen/YzPrLBL %}

You can play around more with it if you like. Do let me know what you think of this in the comments below.
Thanks for reading.
How did my resolution for 2019 work out?
Tags: resolutions, books
Published: 2020-01-01 16:12:29

---
title: How did my resolution for 2019 work out?
published: true
description: Went from reading no books to Audible!
tags: resolutions, books
---

Since joining Audible last year I went from reading close to no books to listening and learning 10.5 books in 2019!

<b>Here is my list:</b>

- Hitchhiker's Guide to the Galaxy
- Blood, Sweat and Pixels
- Becoming
- Power Moves
- Hit Refresh
- Good Omens
- Born a Crime
- A Polaroid guy in a Snap Chat world
- Hi Bob!
- Out of My Mind
- The Innovators (half done)

<b>My favorites were (in order):</b>

1 - Blood, Sweat and Pixels (read this book!)
2 - Hitchhiker's Guide to the Galaxy (great story)
3 - Becoming (really good, read by Michelle. Obama)
4 - Hit Refresh (interesting)
5 - Power Moves (well done for audio)

<b>My least favorites were (in order):</b>

1 - Hi Bob! (wasn't what I thought it would be)
2 - Out of my mind (it was, just OK)
2 - Born a Crime (a lot heavier than I thought)
3 - Good Omens (good story but confusing at times)

<b>I have got a few in my library that I need to get to in 2020:</b>

- The Innovators (need to finish)
- Tools and Weapons
- Educated
- Einstein
- Steve Jobs

As far as 2019 resolutions this one worked out pretty well for me.  

I know to many reading exercises the brain.  But I learned a lot from listening to these books.  I would have never gotten to them otherwise.
Suggestions for application using TMDB 
Tags: java, springboot, webapp
Published: 2020-01-01 15:35:26

I am in process for creating a movie details(kindof) app using Java Spring Boot using API from TMDB.

It already has a API library written in Java. 

Should use this Library directly in my application. Since it will be backbone for all the  things. Is relying on this library good ? or should I write my code from scratch.

This is a project that I am building for my portfolio.
First day of my computer science class
Published: 2020-01-01 15:09:53

---
title: First day of my computer science class
published: True
description: Hey yo, what’s up Good morning. Right now I am a freshman computer science student from Nepal and I wanna share my knowledge of how the day was.
cover_image: https://www.csaju.com/wp-content/uploads/2019/11/IMG_20191115_130034-750x410.jpg
tags: 
---

Hey yo, what’s up Good morning. Right now I am a freshman computer science student from Nepal and I wanna share my knowledge of how the day was.

I’ve just got onto campus from the bus station and head off to the Computer Science department. The first day was not about learning cool stuff like programming, hacking and many more. The class was about to start at 12:00 pm and I was in traffic Jams. So I just go as fast as I can by walking on the street and went to the Campus. I was going to the Computer Science Department to take first-class but boom (thug-life) by Campus. There was no one else and I was only and I start to act little bit weird what the hell is going on? One brother told me that hey bro, today is your computer science orientation and it is going to held in Physic Department.


After onwards, I went to the physic department and I meet new fellows. And It was awesome and having some meal too. We did some stupid things too like food was given to each and every one freshman student and we took two times. It was fun to do during orientation. We learned the syllabus and some tips told by Computer Science professors and other department professors too. And kind of knowledge of campus history and hostel too. After the end of the orientation of class instead of learning to hack and code, we just meet and make new friends. And time went so fast that we even didn’t notice and went to the hostel by walking and talking with friends. That’s how the day went in my first computer science class. If you wanna know more tips and something valuable stay connect and thank you.

Posted in [csaju.com] (https://www.csaju.com/first-day-of-my-computer-science-class/)
Add a commenting platform to a Svelte app
Tags: svelte, webdev, blog, discussions
Published: 2020-01-01 15:07:09

_This post first appeared on [www.mikenikles.com](https://www.mikenikles.com/blog/add-a-commenting-platform-to-a-svelte-app). Photo by [Art Lasovsky](https://unsplash.com/@artlasovsky?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/writing?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_

Happy new year!

I recently [relaunched](https://www.mikenikles.com/blog/migrating-from-medium-to-my-own-blog) my personal blog at www.mikenikles.com using Svelte ([learn why](https://www.mikenikles.com/blog/why-i-moved-from-react-to-svelte-and-why-others-will-follow)).

Initial feedback was to allow visitors to leave comments and have discussions. I took that feedback and found www.commento.io which looked lightweight enough and straitforward to implement.

What I did:
1. Sign up at www.commento.io
2. Create a Svelte component that displays comments

The component is as simple as this ([corresponding pull request](https://github.com/mikenikles/www-mikenikles-com/pull/4/files)):

```svelte
<svelte:head>
  <script src="https://cdn.commento.io/js/commento.js"></script>
</svelte:head>

<h2>Comments, Feedback, Thoughts</h2>
<div id="commento" />
```

## Configuration

You can style the commenting platform by providing a `data-css-override` attribute to the `script` tag, for example:

```html
<script src="https://cdn.commento.io/js/commento.js" data-css-override="http://example.com/my-custom-styling.css"></script>
```

Additional configuration options can be found in [the documentation](https://docs.commento.io/configuration/frontend/).

Are there other alternatives you have experience with? What do you like / dislike about them?
What would you like to learn in 2020?
Tags: discuss, challenge, career, motivation
Published: 2020-01-01 15:04:47

As developers we have to learn new things on a daily basis. It is a being a while since I want to learn something not related to my current work. I'm interested in the idea of learning a new language. I mainly code in JavaScript it could be refreshing to see other syntaxes. I guess it will be my main goal this year.

What is the thing you absolutely want to learn in 2020?
Manage rails cache by Web UI (Redis, Memory, etc...)
Tags: rails, ruby, webdev, showdev
Published: 2020-01-01 15:01:42

Hi, I come to present you with a gem that I have just made.

I work in a company where we use the cache a lot (Redis) and sometimes we need to delete our cache keys, which can be "boring" to do that we have to delete several keys. So I made a tool with a web interface (made with [Bootstrap](https://getbootstrap.com) which allows you to delete keys more quickly.

For the moment this tool works just for `RedisCacheStore`, `MemoryStore` and `FileStore`.


Here is the link: [RailsWebCache](https://github.com/BorisBresciani/rails_web_cache)

Enjoy ! 🙂
Speed up development by adding bash aliases
Tags: bash, git, productivity, beginners
Published: 2020-01-01 14:58:37

Currently, I'm using two git accounts with separated keys, one for side projects and one for the company I'm working for. I have to switch to the second account each time I am using a new shell window and want to push changes using a different account:

```git
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/company

git push origin something
```

it is quite annoying. However, it can be easily replaced with a simple bash alias with a meaningful name that you would always remember.

## Creating a bash alias

Mainly, there are two user-level files which system run when a bash shell starts - `~/.bash_profile` and `~/.bashrc`. You have to edit one of them to add our alias. The alias format is the following:

```shell
alias alias_name='command1;command2'
```

in my case I have to run two commands so the alias looks like this:

```shell
alias company_git='eval "$(ssh-agent -s)";ssh-add ~/.ssh/company'
```

Now I can simply type `company_git` in terminal each time I open a new shell window and I want to be ready to push some code to the company repositories. It's so simple but makes the development less frustrating.

Thank you for reading! Follow me on [Twitter](https://twitter.com/pdabrowski6) to be up to date with the latest tips, articles, and videos about programming.
BuyMeACoffee
Tags: watercooler
Published: 2020-01-01 14:34:12

<img src=https://i.imgflip.com/11lg70.jpg#>
My Twitter Account: Am I joke to you?

Hey Fellow Devs,

I am now on [buymeacoffee](https://www.buymeacoffee.co) as [pagalprogrammer](https://www.buymeacoffee.com/pagalprogrammer)

Show your ❤️ or just follow me on [@codewithankit](https://twitter.com/codewithAnkit)
Order of arguments in HOF
Tags: javascript, question
Published: 2020-01-01 14:32:08

Does anybody know what's the specific reason for having the arguments in the methods like `map`, `reduce` etc which are found in different js libraries is in the data-first, function last order?

Let's take an example below

```javascript
function square(n) {
  return n * n;
}
 
_.map([4, 8], square);
```

So in the above method `_.map`, the first argument is array while the second is the method. Is there any specific reason behind this?
Daily Challenge #151 - Reverse Parentheses 
Tags: challenge
Published: 2020-01-01 14:30:18

---
title: Daily Challenge #151 - Reverse Parentheses 
published: true
series: Daily Challenge
description: Write a function that will flip the order of content inside parentheses. 
tags: challenge
---
###Setup
For this challenge, you will be given a string of text and valid parentheses as input. Write a function that will return the string with the text inside parentheses reversed. If there are nested parentheses, then that too must be reversed. This pattern should repeat for however many layers of parentheses there are. 

###Examples
`reverseInParens("h(el)lo") == "h(le)lo");`
`reverseInParens("a ((d e) c b)") == "a (b c (d e))");`

###Tests 
`reverseInParens("one (ruof ((rht)ee) owt)")`
`reverseInParens("one (two (three) four)")`

Good luck and have fun!

***
_This [challenge](https://www.codewars.com/kata/5e07b5c55654a900230f0229) comes from dmercertaylor on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
JavaScript braces quiz
Tags: es6, javascript, quiz
Published: 2020-01-01 14:22:42

My favourite example of a perfectly valid JavaScript code that shows all the weird stuff that's possible to do with braces, parentheses and few of the ES6 syntax additions:

```js
let a = 1;
let b = 10;
let c = 100;

({ b: a = ++c } = (({ b: c = a } = { c: { b: ++a } }) => ({ b: ++c }))({ b: ++c }));

console.log(a, b, c);
```

Quite an extreme interview question if you ask me. But can you figure out, using just your head, what will be the output in the terminal?
A 2019 retrospective and looking forward to 2020
Tags: yearinreview, 2019, career, motivation
Published: 2020-01-01 14:11:23

2019 was a year of 'doing stuff' for me. With the momentum I gathered this year, I want to make 2020 the year of 'doing more stuff'.


So in the spirit of 'doing more stuff', let's start 2020 off on the right foot.

I've hacked together a quick visualisation of 2019 with React!


Check it out [here](https://retrospective-2019.herokuapp.com/) (not optimised for mobile 😉)


The things I want to do in 2020 are the following:

- Continue learning React and mastering all it's intricacies 
- **Launch a SaaS product and get a few users**
- **Set up a personal blog and post there first and link to DEV**
- Be an active part of the DEV community and build a following
- Improve my understanding of Go
- Continue my focus on building scalable systems in Java and Spring Boot
- Keep going with gym!

And of course, I will be writing about most of it here. This post is mostly to build some accountability for myself.