teleren/devto huggingface dataset:
Grunt for Beginners
Published: 2019-10-21 05:53:44


Grunt is automation created by Ben Alman. Many companies use grunt to name the same are Walmart, Microsoft, Adobe, jQuery, Twitter, Mozilla, Bootstrap. It is also a build/task manager written on top Node.js.Some advantages are that it can make your code run more efficiently. This article will discuss many things such as installing it on the terminal, the three components, concatenation, uglify, minification, and how they all tie together.
	To use grunt you need to install it in the command line interface globally, so you can use it on many projects. The command line you enter is npm install -g grunt -cli.  The -g stands for globally, the grunt allows it to be run in any directory. The grunt -cli stand for it to be multiple versions installed simultaneously. People use Grunt because of having the idea of having a common set of tasks that can be executed across many unique repositories. There are three components to Grunt, they are the command-line interface, a repositories Grunt file, great plugins. 
	The `Gruntfile.js` or the `Gruntfile.coffe` file is a valid belong in the root directory that is right next to package.json. This file should be committed to the project source.  The Grunt file has four parts the function, project and task configuration, loading Grunt plugins and tasks, and custom task. Installing plug-in the terminal can be tricky. However, the easiest way to install a plugin is npm install <module> --save -dev. For the <module> I highly recommend downloading the module starting with grunt -contrib…. By doing that, the plugin that the creator made, and it is well documented. The three popular plugins are concatenation, minification, and uglify.
	To download any of these plugins you would follow the command line to download plugin replacing the module with the respected plugin name. Concat will concatenate a specified amount of files into one. This will save time on reading pages. Minify gets rids of white spaces, which make the computer quicker to read. Uglify changes the variable and functions name up. By doing that, it will provide security and making it hard to understand what is going on. Most people use all there and by doing all that, it will create or app development to run faster and provide security. 
	There is still a lot you definitely should read about because Grunt is very effective, yet very complex. Grunt is a task and environmental runner, and is broken down three components are the command-line interface, a repositories Grunt file, great plugins. Can use concat, minify, and uglify to make your code fast and secure. Also, I highly recommend to check out the grunt documentations.
why the maven is so annoying with spring-boot?
Published: 2019-10-21 11:41:55

Recently I'm reading  'Pro Spring Boot 2: An authoritative guide to build...'

Basically I get errors for every chapter and every code demo.

And the spring boot, I can say that it really sucks when I deal with the dependency errors. I followed guidelines provided by offical spring boot documentation( Link: https://spring.io/guides/gs/spring-boot/ ), but the pom.xml just prompts error in my IDEA community edition.

Really speechless.

With python to develop web, things are not so annoying. Errors just keep showing..

What should I do?
Section Syntax – Next Generation Shell
Tags: ngs, programming
Published: 2020-03-23 21:33:26

---
title: Section Syntax – Next Generation Shell
published: true
date: 2019-10-21 11:34:15 UTC
tags: NGS,Programming
canonical_url: https://ilya-sher.org/2019/10/21/section-syntax-next-generation-shell/
---

## Problem 

Using comments to denote code sections feels like subpar solution.

One starts with something like the following:

```
// workaround for API stupidity
if(result === null) {
  result = [];
}
```

Then somebody adds another bit so it becomes:

```
// workaround for API stupidity
if(result === null) {
  result = [];
}
if(result === [1]) {
  foo();
}
```

Now you are not sure whether the second `if` is still workaround. You don’t want that. What I usually do in this situation and recommend to others is clearly mark start and end:

```
// workaround for API stupidity - start
if(result === null) {
  result = [];
}
// workaround for API stupidity - end

if(result === [1]) {
  foo();
}
```

Now you have duplicated text and subpar programming experience.

## Solution

Today (2019-10-21) I have added `section` syntax (to `dev` branch) to the language I am working on, [Next Generation Shell](https://ngs-lang.org/). I think it solves the problem in a clean way, consistent with syntax and semantics of the language:

```
section "workaround for API stupidity" {
  if result is Null {
    result = []
  }
}
```

Or:

```
result = section "Use algorithm X to calculate blah" {
  a = 1
  b = 2
  a + b
}
```

In future, for programmer’s convenience backtraces could be augmented with sections’ names.

## Update: discussion

1. [https://www.reddit.com/r/ProgrammingLanguages/comments/dkzcls/section\_syntax\_next\_generation\_shell/](https://www.reddit.com/r/ProgrammingLanguages/comments/dkzcls/section_syntax_next_generation_shell/)
2. [https://lobste.rs/s/gert97/section\_syntax\_next\_generation\_shell](https://lobste.rs/s/gert97/section_syntax_next_generation_shell)

* * *

Have a nice week!
Study Group - Week 1
Tags: makers, commandline, git, github
Published: 2019-10-21 09:06:13

So after I had completed the first week of the Makers pre-course material I decided to check if anyone wanted to start a small study group where we just go over the challenge of the week before, most of the people in the slack group thought it was a great idea it gave us a chance to meet each other and also work through the challenges.

We met up yesterday for the study group at the Ace Hotel which was a pretty nice spot for meeting up because it was full of developers, close to makers and had a long table that we were able to gather around making communication easier. there was only five of us but some people were busy, We all came in one at a time but because I was the one who organised it I thought I should be there first so I got up early and headed in, because I was finished that section I was keen to offer my help to whoever needed it because it'd plus it had the added benefit of being revision for me so a win-win. I think the main problem people were running into was piping, which is used to take the output of the command before the pipe and use it as input for the command after the pipe, but we were chaining multiple pipes so a little more complicated, so I suggested using the way I used pipes, by adding a pipe one by one so you can actually see the differences between the first output and the second output giving you a visual reference for what each step is doing. But there was a person there who had completed the whole course and also done a lot of the same prep I had done so it was interesting to get his take on the course, it also means there's someone I can run to if I run into problems in the future.

Ultimately they were a lovely group of people and I'm looking forward to working with them in the future and hopefully we'll get more people to join us next week.
[Off topic] John Sonmez is not a Simple Programmr
Tags: offtopic, watercooler
Published: 2019-10-21 10:18:37

---
title: [Off topic] John Sonmez is not a Simple Programmr
published: true
description: 
tags: offtopic, watercooler 
---

I am usually not one to judge you in a few tweets, but wow this guy is proud of them. I am actually kinda sad that people like him have a platform to voice their hate. Won't say much since is all over twitter, but just wanted to raise awareness.

Tae'lur which I follow, and some other devs tweeted about it.

{% tweet 1186124295275270144 %}

Another tweet by Michael Dowden:

{% tweet 1186128959123132416 %}

Another tweet by Quincy Larson:

{% tweet 1186124777246904325 %}

Maybe @ben can give us the pleasure of erasing this man from dev.to there are quite few a posts praising John in several podcasts.
What is your current web development tech stack?
Tags: discuss, webdev, tools, programming
Published: 2019-10-21 10:08:09

---
title: What is your current web development tech stack?
published: true
description: Why do you prefer some technologies in your web development tech stack over the rest? 
tags: discuss, webdev, tools, programming
cover_image: https://thepracticaldev.s3.amazonaws.com/i/2ea3ztunlphlf508b796.jpg
---

This is some kind of a poll to understand what is your current tech stack for web development.
There are no right or wrong stacks, I just want to know why you choose some technologies over the rest.

For example, in the company I worked in we used:
<h3>In backend development</h3>

Programming languages – Ruby, JavaScript, PHP
Server – Nginx
Frameworks – Ruby on Rails, Hanami, Sinatra, Node.js, Express
Databases – MongoDB, Elasticsearch, Solr, Redis, Mysql, Postgres, Neo4j

<h3>Frontend tech stack</h3>

Libraries – React.js, Redux, Mobx, Apollo, GraphQL
Programming languages – JavaScript (ES5, ES6, etc.), Typescript
Markup – HTML5, CSS3

<h3>Infrastructure and DevOps</h3>

Configuration, DevOps – Docker, Kubernetes, Terraform, Ansible, Capistrano
Hosting – AWS, Heroku, Google Cloud, Microsoft Azure, DigitalOcean

<h3>Why we use Rails?</h3> 
In a nutshell, Ruby on Rails backend development helps the workload become easier for software architects and developers through the collection of pre-packaged codes that make the development of the backend seamless and fast. It makes the entire programming a lot speedier and more profitable. 

<h3>Other technologies</h3>
Talking about other technologies my previous company used in web development:

- Node.js because it is perfect for backend development of real-time and chat apps, workforce and facility management apps, web portals and field service apps. 
- PHP is great for general website development and server-side scripting, as well as supporting WordPress and Drupal projects. Also, it supports a wide range of databases. 
- React.js framework helps us to develop fast, scalable and simple user interfaces. We use it for stock trading and e-commerce solutions, web-based video conference apps, and other frontend services. React allows us to create large web applications that can change data without reloading the page.

What about your web development tech stack?
How to create a parser with Apache Tika
Tags: java
Published: 2019-10-21 10:03:17

---
title: How to create a parser with Apache Tika
published: true
description: We look into how to create an application parsing different documents with embedded content in order to extract text and images.
tags: java
cover_image: https://thepracticaldev.s3.amazonaws.com/i/i2zlqkinu0kfqyyax58a.jpg
---

{% youtube z-N409RuPf0 %}

We look into how to create an application parsing different documents with embedded content in order to extract text and images.
Is anyone else interested in #esolangs?
Tags: esolangs, discuss, watercooler
Published: 2019-10-21 09:40:27

I'm endlessly fascinated by the variety of programming languages people seem to be able to come up with. [Esolangs.org](https://esolangs.org/) has become one of my favourite websites over the past few years. So I was wondering... _is anyone else on Dev interested in esoteric programming languages?_

I noticed that I'm __the only person__ who's ever made a post with the `#esolangs` tag. Am I alone in my love for these misfits?

---

An esolang I recently found that I think is really cool is [legit](https://morr.cc/legit/), a language where programs are defined by the commit messages in a Git repository graph. The structure of the graph and the content of the commit messages determines the function of the program (the contents of the repo itself are ignored).

A ["Hello World!" program in legit](https://github.com/blinry/legit-hello) looks like:

```
$ git log --graph --oneline
*   b63fd70 (HEAD -> master, origin/master, origin/HEAD) Merge pull request #1 from rohieb/master
|\  
| *   1f44c51 0
| |\  
| |/  
|/|   
* | b9e1e95 "Hello world\n"
| * fbb02fe "Hello world!\n"
|/  
*   8013037 (tag: reverse-loop) dup
|\  
| * 6883822 write 1 left [reverse-loop]
*   e0a4d04 (tag: print-loop) 1 right read dup
|\  
| * d646ef4 put [print-loop]
* 25a3a62 quit
```
"Haskell on the JVM" :: Frege vs. Eta
Tags: help, discuss, java, haskell
Published: 2019-10-21 09:33:20

Both [Frege](https://github.com/Frege/frege) and [Eta](https://github.com/typelead/eta) purport to be "Haskell for the JVM".

Frege is older, so I would assume more stable, but I'd never heard of it before today. It seems to be essentially the same language as Eta, which I've at least heard of (though never used).

Does anyone have experience with either / both of these languages? Are there any major differences between them?

---

> _originally posted on [Reddit](https://www.reddit.com/r/esolangs/comments/dkxsqi/haskell_on_the_jvm_frege_vs_eta/)_
Linting, committing and pushing your code in one magic command
Tags: productivity, git
Published: 2019-10-21 08:41:46

I recently realised that every day I do the same set of commands over and over:

```bash
yarn eslint src/some/folders/**/*.js --fix
git add .
git commit -m "commit message"
git push
```

What if I could increase my productivity by merging this all into one command? 🤔 

## The magic command
Now when I run:

```bash
magic "commit message"
```

My code will be linted, committed and pushed! 🎉 

To accomplish this, I’m storing the following aliases in my `~/.bashrc` file:

```bash
alias lint="git add . && git diff HEAD --name-only --diff-filter=d | grep '.*.js$' | xargs yarn eslint --fix"
alias magic='f() {branch=$(git rev-parse --abbrev-ref HEAD); lint && git add . && git commit -m "$1" && git push -u origin $branch;};f'
```

Read on if you want a bit more of an explanation of what’s happening.

## Linting your changed files
```bash
git add . && git diff HEAD --name-only --diff-filter=d |
grep '.*.js$' |
xargs yarn eslint --fix
```

- I run `git add .`  first to make sure any new files that I’ve added are being tracked by git
- `git diff --staged --name-only` will grab the file names of all staged files
- `--diff-filter=d` ignores the files that have been deleted (we don’t need to lint those!)
- the `grep` will find only files ending in `.js`
- Finally we run  `yarn eslint --fix` on each of those files

You may have to modify this depending on your linting setup, and what file extensions you use. Thanks to Masato Ohba, who provided the [initial snippet](https://dev.to/ohbarye/lint-only-over-changed-files-4e7j).


## Adding, committing, and pushing your code
```bash
f() {
    branch=$(git rev-parse --abbrev-ref HEAD);
    lint && git add . && git commit -m "$1" && git push -u origin $branch;
}
```

- We are storing the current branch name in `$branch`
-  `$1` refers to the first argument that we pass in - the commit message
- `-u` is the shortened form of `--set-upstream` (which you only need to do the first time you push after creating a branch)

## Thanks for reading!

Let me know if this works for you, or if you have any cool aliases you’d like to share!
python-benedict: dict subclass with keypath support, standardized IO shortcuts and many utilities.
Tags: python, opensource, showdev, webdev
Published: 2019-10-21 08:20:28

Recently I was involved in a project were I had to **load data from different providers**, each one providing data in a different format, `JSON` in the best case but even in `XML` or `YAML`.

Received data was dirty and pretty far from being the data you would like to receive, for example:

-  Extra white space in values
-  Boolean values expressed using words like `Yes` or `No`
-  Datetime values always expressed in different formats
-  Keys didn't respect a standard naming convention like `snake_case` or `camelCase`
-  Unexpected data structure changes without any warning by the provider

To wake me up from this nightmare I decided to normalize and simplify the whole process reducing unexpected errors near to zero.

The abstract problem was always the same:

-  **Reading/writing** data from/to different formats in a standard way
-  Accessing nested data values quickly, using **keypath**
-  Get data values trying to **parse** them in the expected type

**I decided to write my own library.**

-----

`python-benedict` is a `dict` subclass with **keypath** support, **I/O** shortcuts (`Base64`, `JSON`, `TOML`, `XML`, `YAML`, `query-string`) and **many utility methods**.

It's **open-source** on GitHub:
[https://github.com/fabiocaccamo/python-benedict](https://github.com/fabiocaccamo/python-benedict)

Check it out, any feedback is appreciated.
Thanks
Turn your Macbook into a gaming pc
Published: 2019-10-21 08:15:23

Everyone who's tried playing games on their Macbook will notice that it's probably not a good idea. The graphics in a Macbook are very weak and therefore, can't handle most of the games today. They're generally used for basic computer browsing and school because of its simple design. Most people would just build a gaming pc and separate gaming from work. Now, what if we're interested in doing both? Lucky for us, when there is a will, there is a way. The newer Macbooks these days support Thunderbolt 3. What that means is, your Macbook can handle the fastest port available on computers today. This Thunderbolt 3 is a USB-C port and can be connected to one of the Macbook ports. A gaming pc would usually have a case that stores everything a computer needs in order to work. A Macbook already has the essentials except for a GPU. A Thunderbolt 3 can be connected to an external GPU and be used as a graphics card for a Macbook. That's basically how a Macbook can be used for games. For the setup, you're going to need a power supply that's 600W or more and a graphics card with a USB-C port. Connect the power supply to the graphics card and the Thunderbolt 3 port to the graphics card. The last step is to just connect the other end of the port to your Macbook. Your computer will be able see the connection and use the external GPU as your graphics instead of the Intel graphics. Your Macbook that isn't so great at gaming is now ready for some games.
Transforming deployed configuration file in Azure web app
Tags: новости
Published: 2019-10-21 10:28:42

---
title: Transforming deployed configuration file in Azure web app
published: true
date: 2019-10-21 07:03:35 UTC
tags: Новости
canonical_url: 
---

While this guide is primarily targeted towards usage with Azure Web apps and Sitecore ASP.NET solution deployed on them, still it is possible to use it on on-premise solution with other types on ASP.NET projects, running on Windows.

## Reasoning behind this

Why I actually started building all this thing up, ignoring interesting Helix publishing pipeline or dropping idea of storing source and transformation files in my source control?

In Helix publishing pipeline I do not like the fact that I could not use different transformation based on roles, where I am deploying (if it is there - can you point it to me?).

When storing vanilla config in source control - I do not like the fact that I will need to update it when I am updating Sitecore version (hence, merging and solving possible conflicts).

### Solution

So, I decided to build this transformation thing anew, almost from scratch. I used the same idea as used in Helix publishing pipeline: store only transformation files under source control, as, in general, they are generic. Also, I agreed on following naming convention:

* configFileName.config.xdt - transforms config file with name configFileName.config lying at this path for all environments
* configFileName.config.xdt.roleName - transforms config file with name configFileName.config lying at this path when deploying this particular role

{% gist https://gist.github.com/akuryan/80b3496237604a5e22c938d8eab97b28 %}

That's is a script, which could be uploaded to web app and executed via Kudu. Script wants several parameters:

* folderWithTransforms - (optional) folder, where all transform files are residing; if not specified - script folder is taken
* webRoot - (optional) folder, where webRoot could be found; if not specified, folder 2 levels upper is taken
* roleName - optional, if there is a specific tranformations for this particular role
* transformationAssemblyPath - if Microsoft.Web.XmlTransform.dll is not at the same path as script
Hacktoberfest 2019 🏆
Tags: hacktoberfest, opensource, discuss, javascript
Published: 2019-10-21 07:01:01

---
title: Hacktoberfest 2019 🏆

published: true
description: Hacktoberfest 2019 challenge
tags: hacktoberfest, opensource, discuss, javascript
---

DONE ✅ #Hacktoberfest #OpenSource 💪
I just completed the #hacktoberfest2019 challenge with more than 4 pull requests successfully merged. 
@hacktoberfest

Who else have?

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/esef1sws3kjmf0gi9sk2.png)
Override Git config based on project path
Tags: git, productivity, tips
Published: 2019-10-21 06:54:58

---
title: Override Git config based on project path
published: true
description: Since version 2.13 Git configuration can be overridden depending of a project parent folder 
tags: git, productivity, tips
---

Recently I got a new laptop from my employer that I planned to use for personal projects also. 

The problem that I faced, was that I didn't want my personal email to appear on company projects commit history, nor my professional email on personal projects. 

I could have set my professional email globally and then override it on each of my personal projects. But I am too lazy to do it, and I know that sometimes in the future I will forget to set my personal email in a new project.

As I take the habit to regroup all personal project under the same folder, I wanted to put a `.gitconfig` file in this directory and have it load by Git when I was inside, but it didn't work because Git is only looking for configuration locally (`.git/config`) or globally (`~/.gitconfig).

Finally I found a solution, thanks to a StackOverflow, that since Git version 2.13 it is possible to use `includeIf` directive to conditionally include configuration files.

The `includeIf` directive accept the two following criteria 
- gitdir: to specify a glob pattern that will be compared to a project `.git` folder path
- branch: to specify a branch that will be compared to a project current branch

When the criteria are met, it includes the file given with the `path` parameter

Whis this new information I was able to set automatically my email for all my personal projects by putting these 2 lines in my `~/.gitconfig` file. 

{% gist https://gist.github.com/NotGrm/aca2f30342d72912c101eb1769a95487 %} 

![](https://media.giphy.com/media/rUGFUviYeWO2I/giphy.gif)

### Links
- [StackOverflow thread who helped me](https://stackoverflow.com/questions/21307793/set-git-config-values-for-all-child-folders/37167110)
- [Conditionnal includes on Git-SCM](https://git-scm.com/docs/git-config#_conditional_includes)