teleren/devto huggingface dataset:
Mastering GNU grep and ripgrep
Tags: beginners, grep, linux, ebook
Published: 2019-05-16 11:33:49

---
title: "Mastering GNU grep and ripgrep"
published: true
description: "Example based guide to mastering GNU grep and ripgrep"
tags: beginners,grep,linux,ebook
canonical_url: https://learnbyexample.github.io/grep-book-announcement/
---

Hello!

I recently published my book on **GNU GREP and RIPGREP**

![grep cover image](https://learnbyexample.github.io/images/books/grep.png)

Get the e-book using either of these sites:

* https://gumroad.com/l/gnugrep_ripgrep
* https://leanpub.com/gnugrep_ripgrep

You can also get the ebooks as part of **Magical one-liners** bundle using these links:

* [https://gumroad.com/l/oneliners](https://gumroad.com/l/oneliners)
* [https://leanpub.com/b/oneliners](https://leanpub.com/b/oneliners)

You can also get the ebooks as part of **Awesome Regex** bundle using these links:

* [https://gumroad.com/l/regex](https://gumroad.com/l/regex)
* [https://leanpub.com/b/regex](https://leanpub.com/b/regex)

**Note** Please use a valid e-mail and save the mail you receive, you'll get free updates for future versions.

Code snippets, example files, sample chapters, etc are available at https://github.com/learnbyexample/learn_gnugrep_ripgrep

This book covers features of `GNU grep` and `ripgrep` along with discussion on BRE/ERE/PCRE(2)/Rust `regular expressions`. Examples are used extensively, please follow along by typing them out. Exercises are also included to test your understanding.

Some of you might be familiar with my Command Line Text Processing repo.

{% github learnbyexample/Command-line-text-processing %}

This book is based on the `grep` chapter - edited to add more descriptions, better examples, exercises, etc. Also, I took the plunge and checked out `ripgrep` while working on this book. I'd assumed it would be similar to `gnu grep` and I just need simple changes to present it in the book. Well, it turned out lot more work and I had to settle for not covering all the options and customizations. In hindsight, would've been better if I did a separate book. Speed wise, `ripgrep` is very impressive and has plenty of additional nice features. For example: the multiline `-U` and replace `-r` options of `ripgrep` are quite handy - you can use this instead of `sed` for some cases with added advantage of speed, `-F` option and better regex features.

**Table of Contents**

* Preface
* Introduction
* Frequently used options
* BRE/ERE Regular Expressions
* Context matching
* Recursive search
* Miscellaneous options
* Perl Compatible Regular Expressions
* Gotchas and Tricks
* ripgrep
* Further Reading

Hope you find the book useful. I would be grateful for your feedback, book review and suggestions.

Happy learning :)
Dart getters and setters
Tags: flutter, dart, getter, setter
Published: 2019-05-16 11:24:23

## Prerequisites
You will need basic knowledge of
1. Dart
3. Object-Oriented Programming

Getters and setters are special methods that provide read and write access to an object’s properties. Each instance variable of your class has an implicit getter, and a setter if needed. In dart, you can take this even further by implementing your own getters and setters. If you've had any experience in Object-Oriented Programming you'll feel right at home. Let's get started.

In OOP a class acts as an Abstract Data Type(ADT) for an instance of that class(Object). In dart, this is also the case. The basic syntax for a class is:

```dart
class className {
 fields;
 getters/setters
 constructor
 methods/functions
}
```
The getters and setters can also be placed after the constructor. Now let's create a class and instantiate it.

```dart
class Vehicle {
  String make;
  String model;
  int manufactureYear;
  int vehicleAge;
  String color;
  
  int get age {
    return vehicleAge;
  }
  
  void set age(int currentYear) {
    vehicleAge = currentYear - manufactureYear;
  }

  // We can also eliminate the setter and just use a getter.
  //int get age {
  //  return DateTime.now().year - manufactureYear;
  //}
  
  Vehicle({this.make,this.model,this.manufactureYear,this.color,});
}
```
Age here is both a getter and a setter. Let's see how we can use it.

```dart
void main() {
 Vehicle car = 
 Vehicle(make:"Honda",model:"Civic",manufactureYear:2010,color:"red");
  print(car.make); // output - Honda
  print(car.model); // output - Civic
  car.age = 2019;
  print(car.age); // output - 9
   
}
```
One of my favourite ways of using getters is getting a `Map` from an object.
```dart
void main() {
 Vehicle car = Vehicle(make:"Honda",model:"Civic",manufactureYear:2010,color:"red");
  print(car.map); // output - {make: Honda, model: Civic, manufactureYear: 2010, color: red}
}
class Vehicle {
  String make;
  String model;
  int manufactureYear;
  int vehicleAge;
  String color;
  
 
  
  Map<String,dynamic> get map {
    return {
      "make": make,
      "model": model,
      "manufactureYear":manufactureYear,
      "color": color,
    };
  }
  
  int get age {
    return DateTime.now().year - manufactureYear;
  }
  
  void set age(int currentYear) {
    vehicleAge = currentYear - manufactureYear;
  }
  
  Vehicle({this.make,this.model,this.manufactureYear,this.color,});
}
```

That covers basic usage of getter and setters in Dart. There's is a lot more to learn about classes. I will cover everything in a future post. Also, note the use of named parameters in our constructors. I'll also cover those and other ways of passing parameters in a future post
Twitch IRC Capability WebSocket (help)
Tags: help, twitch, websocket, javascript
Published: 2019-05-16 11:15:31

---
title: Twitch IRC Capability WebSocket (help)
published: true
description: Twitch IRC Capability WebSocket Need help
tags: help, twitch, websocket, javascript
---

I'am trying to get a event when a moderator unban a user in the chat, i send a resquest for twitch.tv/tags but i didn't receive any messages when user was ban or unban...

it is my actual code :
```javascript
const WebSocket = require('ws');

const ws = new WebSocket('wss://irc-ws.chat.twitch.tv:443');

ws.onopen = function(event) {
  console.log('INFO: Socket Opened'); 
  ws.send('CAP REQ :twitch.tv/commands');
  ws.send('CAP REQ :twitch.tv/membership');
  ws.send('CAP REQ :twitch.tv/tags');
  ws.send('PASS oauth:...');
  ws.send('NICK zaekof_');
  ws.send('JOIN #zaekof_');
  ws.send('USER #zaekof_');
};
ws.onerror = function(error) {
  console.log('ERR: ', error);
};
ws.onclose = function() {
  console.log('INFO: Socket Closed');
}; 
ws.onmessage = function(event) {
  console.log('RECV: ', event.data);
};
```

When i'am connected on irc chat, i receive a follows messages :
```
RECV:  :tmi.twitch.tv CAP * ACK :twitch.tv/commands
RECV:  :tmi.twitch.tv CAP * ACK :twitch.tv/membership
RECV:  :tmi.twitch.tv CAP * ACK :twitch.tv/tags

RECV:  :tmi.twitch.tv 001 zaekof_ :Welcome, GLHF!
:tmi.twitch.tv 002 zaekof_ :Your host is tmi.twitch.tv
:tmi.twitch.tv 003 zaekof_ :This server is rather new
:tmi.twitch.tv 004 zaekof_ :-
:tmi.twitch.tv 375 zaekof_ :-
:tmi.twitch.tv 372 zaekof_ :You are in a maze of twisty passages, all alike.:tmi.twitch.tv 376 zaekof_ :>
```
Would anyone have an idea to help me?

Thanks.
What is React with JSX, and how are JSX and Babel related?
Tags: react
Published: 2019-05-16 10:40:42

---
title: What is React with JSX, and how are JSX and Babel related?
published: true
description: 
tags: #react
---
JSX can best be thought of as a markup syntax that very closely resembles HTML.

React is a library which uses JavaScript functions to generate strings of HTML it inserts into a web page document’s body.

JSX makes writing React components, the building blocks of React UI, easier by making the syntax developers use for generating these strings of HTML almost identical to the HTML they will inject into the web page.

Babel parses JSX syntax, which browsers cannot understand, and transpiles your source code into JavaScript that is less human friendly but will run in browsers.
What is React with JSX, and how are JSX and Babel related?
Tags: react
Published: 2019-05-16 10:36:27

---
title: What is React with JSX, and how are JSX and Babel related?
published: true
description: JSX stands for JavaScript XML, it is just a file that is used by React and is written in JavaScript and HTML. Due to this HTML file becomes easy to understand and applications become robust and their performance is increased.
tags: #react
---
Underrated Articles on Dev.to Last week
Tags: top7, webdev, meta, bestofdev
Published: 2019-05-16 10:23:02

---
title: Underrated Articles on Dev.to Last week
published: true
description: 
tags: icymi, webdev, meta, bestofdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/642odjnkrqxw93v6emgk.png
series: Underrated Articles
---
Hey, you guys! How's it going? I'm back with another installment of underrated DEV posts of last week! Let's check them out.

## 1. Tips for First Time Speaker

In this article, Gokul Kathirvel shares his experience of speaking at the conference for the first time. He also shared how he did preparations for the conference and wrote important tips for readers.
{% link https://dev.to/gokatz/first-time-speaker-fts-with-few-tips-45po %}

## 2. Overcome the Imposter Syndrome

In this article, Manuel writes about the way to battle the impostor syndrome and help someone else in the process. He became more confident in his abilities after overcoming imposter syndrome.
{% link https://dev.to/nelo_mf/mentoring-as-a-way-of-overcoming-the-impostor-syndrome-298h %}

## 3. Mistakes with Web accessibility

 Kim writes about top issues with accessibility and also addressed how she can learn from these mistakes. She highlighted three key points that she found the most interesting and applicable to her coding experience.
{% link https://dev.to/knheidorn/my-top-mistakes-with-web-accessibility-29lh %}

## 4. Thoughts on Being a Newbie 

One should always strive to become a better developer. Nina shares her positive and negative thoughts about being a beginner. She addresses the paradox of endless possibilities, and talks about how to stop underestimating yourself and narrow the search.
{% link https://dev.to/misnina/being-new-is-so-good-it-might-hurt-38o0 %}

## 5. Make Peace with Deadlines

Deadlines are there so that everything syncs. Meeting deadlines have everything to do with strategizing your efforts as a team. Hüseyin writes some facts that should be kept in mind while setting the deadline.
{% link https://dev.to/h_polatyuruk/how-to-make-peace-with-deadlines-in-software-development-2l3l %}

## 6. Using Cyber Security 

Nando explains the use of cybersecurity to build a successful business and create happy customers. By having solid cybersecurity, not only customers even staff of the company feels happier because they don't have to spend hours focusing on whether or not a new piece of software is safe. 
{% link https://dev.to/nandod1707/using-cyber-security-to-maximize-your-company-profits-280n %}

---

*That's all for this week. These were my personal favorite underrated posts from last week. I hope you liked this post. Tell me about your favorite posts that went underrated in the comments below!* ❤️
Next.js E-Commerce Tutorial: Quick Shopping Cart Integration
Tags: javascript, react, webdev, showdev
Published: 2019-05-16 18:16:53

---
title: Next.js E-Commerce Tutorial: Quick Shopping Cart Integration
published: true
tags: javascript, react, webdev, showdev
canonical_url: https://snipcart.com/blog/next-js-ecommerce-tutorial
---

![Next.js E-Commerce Tutorial: Quick Shopping Cart Integration](https://snipcart.com/media/204366/next-js-ecommerce.png)

Each time I come back to [React-related](https://snipcart.com/blog/node-js-react-strapi-tutorial) topics on the blog, its ecosystem seems to have gotten larger, more mature, and efficient.

These days, there isn’t much you can’t do with React, whether you’re a seasoned developer or a complete beginner.

This is mostly due to the creation of tools such as Next.js that have successfully simplified React frontend development.

So, today, I want to **explore what Next.js can do for e-commerce.**

In the technical tutorial below, I’ll show you how to:

- Set up a Next.js development environment
- Create new pages & components
- Fetch data & import components
- Add a shopping cart to a Next.js app
- Style & deploy the app

But before we go through this, let’s make sure we understand what Next.js is and how it can improve your next e-commerce projects.

  

→ Read the full post [here](https://snipcart.com/blog/next-js-ecommerce-tutorial)
My first useful open source project
Tags: tools, taskrunner, go, opensource
Published: 2019-05-16 10:05:37

---
title: My first useful open source project
published: true
description: Simple task runner on directory changes that doesn't produce tons of logs if everything is OK 👌
tags: tools, taskrunner, golang, opensource
---

Hi! I just created my first open source tool, that I think may be useful. It’s a simple task runner on a directory changes.

With it you can:
- Define multiple watchers that contain list of dirs and list of commands to do after any changes in that directories.
- See just few lines of report with real-time status.

Here is a link https://github.com/Enapiuz/multiwatch
There are a lot to do, like hot reloading config, tests and some little features.
New Age Recognition API that can be used not only just for fun
Tags: machinelearning, api, computervision
Published: 2019-05-16 09:54:42

Check out new [Age Recognition API](https://labs.everypixel.com/api/demo)!

This model detects an age of people on photos. Neural network was trained on few datasets up to 300 000 images of people of different gender, age and nationality. Data scientists worked with IMDB and Wikipedia which accumulate plenty photos of celebrities from year to year. They taught AI to monitor how an appearance changes with age and predicted how old people are. 

![Hello, Mark!](https://thepracticaldev.s3.amazonaws.com/i/wgpzascagjrfzg3pnlqw.jpeg)

Model may be used for categorization data in companies collecting information about people (such as model or recruiting agencies), for forming selection of people during social science researches, for verification users of dating services, social media and other services which require a confirmation of age.  

![Recognition of two persons](https://thepracticaldev.s3.amazonaws.com/i/d6xnlw8eozzfy9nynicc.jpeg)

Also, API can be helpful for those who work with photo stock sites both photographers and users. Age Recognition is the addition to Image Keywording, Stock Photo Scoring and Stock Photo Scoring  services, which has been launched by Everypixel Team earlier. In the future Age Recognition will be integrated into DAM-service, that combine all of those tools with sales analysis, to make it more efficient and accurate in auto keywording and searching.

![Hello, Elon!](https://thepracticaldev.s3.amazonaws.com/i/en4s6024ustergas5pnr.jpeg)

Check the accuracy on your own photos:
https://labs.everypixel.com/api/demo
DatoRss - RSS Search Engine (New Look)
Tags: react, showdev, webdev, javascript
Published: 2019-05-16 09:22:16

---
title: DatoRss - RSS Search Engine (New Look)
published: true
description: RSS search engine with ML and semantic functionalities
tags: react, showdev, webdev, javascript
---


just released new version of DatoRSS search engine. Take a look with:

- sentiment
- tags
- more data


www.datorss.com

Note: Based on my own open source project https://github.com/davidesantangelo/feedirss-api

Note2: Help me on Product Hunt https://www.producthunt.com/posts/feedi-search-engine
How Energy Initiatives Will Affect Our Lives and Our Gadgets
Tags: gadget, energy
Published: 2019-05-16 09:11:41


It is sometimes dizzying to think of how quickly modern gadgets have advanced. In the last five years we’ve seen the mobile industry completely reinvented — and that came less than a decade after it started to really take off. It might be difficult to imagine, then, that the pace of innovation could actually increase in the near future. But it appears that we’re headed down just such a path.

The key to it all: energy initiatives. By improving the systems that power our gadgets, we will see breakthroughs in the gadgets themselves.

DC Power
The biggest key to increased efficiency might be something that America’s most famous inventor, Thomas Edison, had advocated more than a century ago. His DC power systems had many advantages, but by the early 20th century Nikola Tesla’s implementation of AC power had become standard due to its ability to cover longer distances.

Yet so many modern gadgets run on DC power. It has, in many ways, become more prominent in our lives now than ever before. Yet our power grids still deliver AC power, which necessitates inefficient conversions. A move towards more DC power would then increase efficiency, which would leave room for more innovation.

Starts at the Data Center

The most prominent DC power initiatives are currently coming at the data center level. Power company ABB has provided DC power services to a number of data centers. They’re reported increased efficiency at those centers. Apple has spearheaded another portion of this initiative, building a solar-powered data center. Since solar cells produce DC power, the two initiatives could go hand-in-hand.

Since data centers control the flow of information to our devices, increased efficiency at that level means not only less energy used, but also increased output. With the inefficiencies corrected, we can receive our data packets faster.

Moving to the Grid
There is little chance that DC power replaces AC power on a grid-wide basis. At least, not any time soon. The AC system is so ingrained that any wide scale change will take years to implement. Yet given the DC dependence of modern technology, we could see a gradual shift start sometime soon and you can read about it <a href="https://essayup.com/">here</a>. Just think about all the electronic devices we use every day that run on DC power: computers, cell phones, tablets, video game consoles, TVs — even hybrid cars run on DC power.

When electricity first started flowing through the country, alternating current made the most sense. It was the most easily deliverable over long distances. Given the scarcity of plants back then, distance was an issue. But with the move towards more DC-powered items, including essentially anything with a computer chip, it could be time for a change. To change from an AC-powered system to a DC-powered one would take years and cost billions. But we’ve finally reached a point where the incentives might line up. You and I, the end users, will stand to benefit greatly.
Cover Reveal! Your First Year in Code
Tags: firstyearincode, book, beginners
Published: 2019-05-16 04:33:34

---
title: Cover Reveal! Your First Year in Code
published: true
description: Updates, release date and more
tags: firstyearincode, book, beginners
---

[Your First Year in Code](https://leanpub.com/firstyearincode) is coming out soon, and it's been an amazing ride! 15 of the best writers in the DEV community have contributed content, we hired an excellent cover designer, and everything is coming along right on schedule.

Our final cover looks like this:

![](https://thepracticaldev.s3.amazonaws.com/i/vnecdcyyjvnxb95tc0e7.jpg)

I'm honored to be working with such amazing developers and writers on this project, and beyond excited for our July publish date.

The content in this book is top-notch. Rosa will explain how to do effective code reviews. Yechiel will teach you some of the best ways to learn on the job. Ilona will talk about the ups and downs of being a woman in tech. Clifford will compare bootcamps and college degrees. And that's just the beginning. This is the book we all wish we'd had back when we were juniors, and it's soon to be yours for the low, low price of whatever you want.

If this sounds like something you'd like to read, go ahead and sign up on the prerelease page: https://leanpub.com/firstyearincode. You'll be the first to know when we go live.

Thanks for your support, everyone, and we're excited to be part of your first, second, or twentieth year in code!
Refactoring in Spacemacs using iedit and helm edit
Tags: spacemacs, refactoring, emacs, iedit
Published: 2019-05-16 08:42:22

---
title: Refactoring in Spacemacs using iedit and helm edit
published: true
description: 
tags: spacemacs, refactoring, Emacs, iedit
---

I recently released [a video] (https://youtu.be/XAHVwhTsF-g) detailing the frankly absurdly powerful refactoring tools in Spacemacs: iedit and helm edit. Check it out, and let me know what videos you'd like to see next :).
Getting Real on the Programming Leadership podcast
Tags: dailywriting
Published: 2019-05-17 17:33:33

---
title: Getting Real on the Programming Leadership podcast
published: true
tags: daily-writing
canonical_url: https://marcusblankenship.com/getting-real-on-the-programming-leadership-podcast/
---

This week on Programming Leadership we discuss “getting real” about software projects.

[Listen Now -> Programming Leadership Podcast](https://marcusblankenship.com/getting-real-establishing-realistic-expectations-team)

## Show notes

- Leadership is creating an environment where everyone can contribute.
- We can’t say yes to something until we can honestly say no to something.
- Look for the good and the bad in the retrospective of a project. Document lessons learned.
- Stop trying to be perfect in front of your boss and colleagues. It’s okay not to know the answer and to be imperfect.
- Just because you can’t get a perfect estimate, doesn’t mean you don’t know something important.
- Why you must learn to say “No” to have better discussions

## Spread the love!

If you enjoyed the episode, please consider sharing it with a few friends who might find it useful. Thanks!

Best,  
Marcus

P.S. Are you exhausted from being in the middle of every project? Are you ready to become a more thoughtful, insightful software manager? The Software Leader Seminar might be for you. Our next session is launching on May 20th, 2019. You can learn more here: [https://marcusblankenship.com/software-leader-seminar-2019/](https://marcusblankenship.com/software-leader-seminar-2019/)

The post [Getting Real on the Programming Leadership podcast](https://marcusblankenship.com/getting-real-on-the-programming-leadership-podcast/) appeared first on [Marcus Blankenship](https://marcusblankenship.com).