teleren/devto huggingface dataset:
MicroENV - Fake REST API
Tags: angular, java, docker, javascript
Published: 2020-02-01 12:21:10

Hello,


I am a backend developer. Because of the need to create a fake rest api service, I made a product that gives this possibility. With this product you can create your Fake rest API online. In addition, it is possible to create docker containers that have a built-in application on the desired port. You can define the input and output parameters yourself. Path params, Query params, Json structure...etc. 

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

The application is supported by teamwork. You can share repositories with your team and limit repository ability to use as a creator. You can get the generated code in Java at any time. The goal is complete customization of use fake rest api. More information about this product can be found at https://microenv.com

I have been able to fulfill my needs with this product, and I hope it will be of some use to others.
Laravel Mobile Verification
Tags: laravelmobileverification, mobileconfirmation, laravel, php
Published: 2020-02-01 12:19:37

---
title: Laravel Mobile Verification
published: true
description: Many web applications require users to verify their mobile numbers before using the application. Rather than forcing you to re-implement this on each application, ‘Laravel Mobile Verification’ is a package that provides convenient methods and features for send, verify and resend verification codes.
tags: #Laravel_mobile_verification #Mobile_confirmation #Laravel #PHP 
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/rbijs76dvjxv0w6ea1ba.JPG
---

Many web applications require users to verify their mobile numbers before using the application. Rather than forcing you to re-implement this on each application, ‘Laravel Mobile Verification’ is a package that provides convenient methods and features for **send**, **verify** and **resend** verification codes.


# Basic Setup
In the beginning, verify that your `User` model implements the `MustVerifyMobile` interface and use respected trait:

{% gist https://gist.github.com/mohammad-fouladgar/c4833dca6859bf2b16349ba7b2989707 %}

Next, you should specify your SMS service which any service (i.e. `Nexmo`, `Twilio`) are applicable. For sending SMS notifications via this package, you need to implement the `SMSClient` interface. This interface requires you to implement `sendMessage` method and this method will return your SMS service API result via a `Payload` object which contains user **mobile number** and **token** message:

{% gist https://gist.github.com/mohammad-fouladgar/8a968e72e502fe63df8ff3b108a67e1f %}

In order to set your SMS Client, you should publish the mobile_verifier.php config file with:
```sh
php artisan vendor:publish --provider="Fouladgar\MobileVerification\ServiceProvider" --tag="config"
```
And set your client class:
{% gist https://gist.github.com/mohammad-fouladgar/aec20546fa81e33707ffc9a7908de415 %}

# Usage

Here is how you can send a verification token after user registration:

{% gist https://gist.github.com/mohammad-fouladgar/03f92366c1bbeba6570202f180915ac7 %}

# Verify

You should send `token` message of an authenticated user to this route `/auth/mobile/verify`:

```sh
curl -X POST \
      http://example.com/auth/mobile/verify \
      -H 'Accept: application/json' \
      -H 'Authorization: YOUR_JWT_TOKEN' \
      -F token=YOUR_VERIFICATION_TOKEN
```

# Resend

If you need to resend a verification token message, you can use this route `/auth/mobile/resend` for an authenticated user:

```sh
curl -X POST \
      http://example.com/auth/mobile/resend \
      -H 'Accept: application/json' \
      -H 'Authorization: YOUR_JWT_TOKEN'
```

For more details, please check out the documentation:

{% github https://github.com/mohammad-fouladgar/laravel-mobile-verification %}
ERP Software in Delhi
Tags: erpsoftwareindelhi
Published: 2020-02-01 12:15:53

<a href="https://www.alphainfotech.com/"><strong>school ERP software in Delhi</strong></a>  (SMS) is the best and efficiently operating school management software. Every School and collage are facing issues regarding the proper management of their day to day activities, student or management, either it can be a teacher.
To need a MockingBird
Tags: mock, perftesting
Published: 2020-02-01 12:09:35

---
title: To need a MockingBird
published: true
description: prologue
tags: mock, perf testing
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/tvute6adhhe9y3j108j2.png
series: mockingbird
---

Weird title, but it'll get clear by the end of the post, I promise!

Mocking is something that is associated with developers more than it is with testers, especially if one is dealing with Unit Tests.

That is not to say that testers don't use it. Mocking is helpful when testers have API specifications but don't have the actual API itself and they have to develop API Automation (because Agile).

In my current project, we are migrating over a legacy ticketing platform (standard .NET stuff & a lot of confused applications) to a new platform comprised of a SaaS based Incident Management system that is supported by multiple "new" microservices with every new age technology stuffed into the architecture somehow (I could fill up a couple of blog posts with snark aimed at the overall thinking in doing something like this, but I digress. Maybe later).

So, the overall system when tested for performance (by yours truly) was doing extremely poor in terms of the lofty expectations set by people who were good at setting expectations :) 

So a few "war" rooms with much yelling and panicky reactions, the performance issue was narrowed down to some faulty API calls that were setting databases on fire in the third party ticketing system (imagine 30-40 second response times on good calls and 62 seconds about 70% of the times, where the expected value was sub-second). Perfectly legal, good API calls, mind you. This in turn dragged down the performance of our "victim" microservice to abysmal levels.  

After much wringing of hands, late night builds & some more panicked conference calls, we ran performance tests that absolved the Third Party SaaS Incident Management System of any wrongdoing. This caused a lot of frayed tempers to be soothed and the hand-wringing moved down to just twitching of fingers. What it did though was give us pause to think. 

What was the actual throughput of our "victim" service? 

Now that we knew that the service's performance was tied to how the SaaS API performed, will we ever know its true performance given how flaky the API was turning out to be?

We decided to setup a performance lab, abstract out the rest of the stuff and just keep the microservice, its common infra and have a mock do the work of the SaaS API.

And that is how we gave birth to our MockingBird - thats what I call the mock API that I built.

The next post will be about how exactly that was accomplished.
It’s February it’s New Month 🎈
Tags: beginners
Published: 2020-02-01 11:28:49

Happy new month friends, I hope January was awesomely filled with good moments 😊. 

Today been the first day of February 
I’m taking my time to share my plans and how I work so my followers can follow the timeline and So will be able to give my best in teaching the little I knew about software development. 


MY TIMELINE: 
I post weekly on my personal tech blog howtothese.xyz and I use dev.to too. 

My focus is to teach absolute beginners the little I know, share tips and work on open projects. 

If you are a web developer beginner Or just getting started with JavaScript you are free to drive in to my blog anytime and learn the little I’m willing to offer cause I know they might be helpful.

Friends it’s new month I wish you all the best 🎊🎉
My First Hackday - Melbourne
Tags: ai, hackathon, melbourne, todayilearned
Published: 2020-02-01 11:11:26

#Self-reflection:

On the 1st of February developers across Melbourne have been invited to SSW's AI hackday; and out of those full-fledged developers, there was one not-so-full-fledged developer. That person was me. 😉
Some may ask, why would I join an event meant for developers who have been programming and creating for years and years? Why would a mere 1st-year undergraduate student participate in such an event?

To be frank, I have no idea where I am heading with my life. For all I know is that I do enjoy programming and wish to be a developer in the future. Being surrounded by friends and classmates who had their whole lives planned out; where every inch of their steps had a purpose, I found myself feeling rather miserable. My life's motto, "going with the flow" seemed like wishful thinking... an ideal scenario where everything would work out at the end.
Not going to lie, I do have some friends who live by these words and are pretty successful in their own rights. But that's not me.
Using my initiative I decided to explore the vast field of computer science in hopes of becoming a polymath at a handful of fields I will enjoy doing.
Anyhow, I decided to sign up for the event that happened to be about AI... and oh boy.. that was daunting. I mean sure, I have been doing quite a bit outside of university; from creating small projects to learning new languages. But none of that came close to what I had signed up for. Well, that's what I had thought initially.

Now fast-forward to the present in which I had already attended this event.

If I had to summarise my experience in one word it would have to be thankful. Even though I may not have understood some of the terminologies, explained and shown during the talk, I did learn. I realised that the whole purpose of a hackday is not only to show off your skills, bringing home a big trophy or the prize money. Sure, it may be rewarding to achieve such high praise and getting recognised for your hard work, but at the end of the day, it doesn't matter if you're first or last.
What matters is the skills you would acquire at such events and friendships formed or potential business partners made.
Now having been to my first hackday I can say with confidence that it won't be my last one.
Lastly, for everyone that are beginners (or perhaps even intermediate) developers, I urge you guys to try something completely new. Whether it may be a hackathon or attending talks. If you go and it doesn't work out for you, great! Now you know what not to do. But if you go do something out of your comfort zone that you do like, that's even better!

Because if you never try, you never know.
✌

Kind Regards,
Thongiboi
Serialize and Deserialize Binary Tree
Tags: python, beginners, leetcode, computerscience
Published: 2020-02-01 10:42:51

This is part of my series where I memo learning from Leetcode. If you have better solutions or ideas, please leave a comment!

## Problems

[Serialize and Deserialize Binary Tree
](https://leetcode.com/explore/learn/card/data-structure-tree/133/conclusion/995/)

We have to serialize a given binary tree to string, and then deserialize the string to the former binary tree.
So let's start with thinking about how to traverse the tree.

## Approach


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7mayqyoa2u04eyps3v2l.png)
(https://leetcode.com/explore/learn/card/data-structure-tree/133/conclusion/995/)

For starters let's think about the above example.
In the above example, the output string is [1, 2, 3, null, null ,4, 5].  
To traverse tree, BFS or DFS is useful and We have to think which one is better. 
 
DFS is more adapted because it will be easier to deserialize than BFS because the order of node encoded on BFS is based on the linkage of nodes.  If you know the other reason to use DFS or you think BFS is more adapted and know the reason why it is, please leave your comment about your opinion!

## Solution

```python
class Codec:

    def serialize(self, root):
        """ Encodes a tree to a single string.
        :type root: TreeNode
        :rtype: str
        """
        def encode(root, string):
            """ a recursive helper function for the serialize() function."""
            # check base case
            if root is None:
                string += 'None,'
            else:
                string += str(root.val) + ','
                string = encode(root.left, string)
                string = encode(root.right, string)
            return string
        
        return encode(root, '')
# Deserialization 
class Codec:

    def deserialize(self, data):
        """Decodes your encoded data to tree.
        :type data: str
        :rtype: TreeNode
        """
        def decode(l):
            """ a recursive helper function for deserialization."""
            if l[0] == 'None':
                l.pop(0)
                return None
                
            root = TreeNode(l[0])
            l.pop(0)
            root.left = decode(l)
            root.right = decode(l)
            return root

        data_list = data.split(',')
        root = decode(data_list)
        return root                

```

Thank you for reading this article!
I always welcome your feedback, question, and idea.
TypeScript Full Stack project (Part III) - NestJS, the server-side
Tags: typescript, nestjs
Published: 2020-02-01 10:30:26

The previous post showed the client-side part. Now, we are going to create the server-side using [NestJS](https://nestjs.com/). That team has done a very great job with the framework but also has awesome documentation as well. If you still not knowing [NestJS](https://nestjs.com/), I strongly recommend you to take a look.

# Server-side

Let&#39;s go to create the [NestJS](https://nestjs.com/) application that we use it as server-side part using its CLI and the following options:

- **package-manager**: *npm*. I prefer *npm* than *yarn* and I am using it inside the rest of the project.

```shell
odin@asgard:~/issues $ nest new server --package-manager npm
```

The new folder structure will contain a new folder *server*, with the [NestJS](https://nestjs.com/) application.

```shell
issues
  ├── client
  ├── .git
  ├── .gitignore
  ├── package.json
  └── server
```

To start the server from the parent folder, issues, we are going to modify the *package.json* adding a new *start:server* script.

```json
{
  ...
  "scripts": {
    "start:server": "npm start --prefix ./server"
  },
  ...
}
```

Now we are able to start the [NestJS](https://nestjs.com/) application:

```shell
odin@asgard:~/issues $ npm run start:server
```

Because of the purpose of this post is not to build a [NestJS](https://nestjs.com/) application, you can get the server-side code from this [repository](https://github.com/yggdrasilts/typescript-full-stack-project/tree/master/server).

If you want to know more about how to use the NestJS CLI, [Kamil Mysliwiec](https://kamilmysliwiec.com/) has written a very interesting post.

> In the next post, I am going to explain how to create the shared libraries part.
Some many ways to ignore file changes in Git
Tags: git
Published: 2020-02-01 10:17:36

When you are working with your team, sometimes you need to ignore files. If a change that involve all the team, you can add the ignored file to the `.gitignore` file of your repo.

This way you have to save a new commit and all the team have to pull the changes, but you can use three more ways.

One of them is creating a `.gitignore.local`, but you also have to add it to the `.gitignore` and creating a new commit.

If you are nos interested in save a commit, you can ignore files locally, saving the ignored file in the global git configuration:

`git config --global core.excludesfile ignored_file`

...or you can use a file created in your git repository called `.git/info/exclude`. This file is basically a `gitignore` but the changes in it are not reflected in the stash.
This is the time to check your knowledge of regex or Regular Expression
Tags: regex, javascript
Published: 2020-02-01 09:34:09

---
title: This is the time to check your knowledge of regex or Regular Expression
published: true
description: You probably say you know regex. Okay, but you really use  it effectively?
tags: regex,JavaScript
---

# Why I wrote this article?  
Because I googled `regex` again, and again.
I thought I needed to clarify what I know about parts of regex.
I will add my knowledge of regex in this post.

## No.0 environment
useful web tool to test regex https://rubular.com/

sample sentences from Wiki https://en.wikipedia.org/wiki/Computer.
In this case, using first two paragraphs.

```
A computer is a machine that can be instructed to carry out sequences of arithmetic or logical operations automatically via computer programming. Modern computers have the ability to follow generalized sets of operations, called programs. These programs enable computers to perform an extremely wide range of tasks. A "complete" computer including the hardware, the operating system (main software), and peripheral equipment required and used for "full" operation can be referred to as a computer system. This term may as well be used for a group of computers that are connected and work together, in particular a computer network or computer cluster.

Computers are used as control systems for a wide variety of industrial and consumer devices. This includes simple special purpose devices like microwave ovens and remote controls, factory devices such as industrial robots and computer-aided design, and also general purpose devices like personal computers and mobile devices such as smartphones. The Internet is run on computers and it connects hundreds of millions of other computers and their users.
```

## No.1 Global match
`Global match` means to return not only first match word or char also others.


ie.
search `in` in sample text.
Below code written in JavaScrip.
``` 
const sample_text = "A computer is a machine ...";// <-- must include whole sample sentences.
console.log(sample_text.match(/in/g));
/*
// return
[
  'in', 'in', 'in',
  'in', 'in', 'in',
  'in', 'in', 'in',
  'in', 'in'
]
*/

```

# To be continued
Laravel 6 | Chaining with the Query Builder
Tags: laravel, query
Published: 2020-02-01 09:07:41

Hey Artisan

In this tutorial we will discuss about laravel query builder. Like eloquent orm, we can use laravel query bulder to manage our data from database.

So let's start our laravel custom query bulder tutorial. The query builder makes it possible to chain methods together. At the end of your chain you’ll use some method—likely get()—to trigger the actual execution of the query you’ve just built.

https://www.codechief.org/article/chaining-with-the-query-builder-in-laravel
Funding social impact for fun and profit
Tags: cryptoeconomics, tokencuratedregistries, tokenbondingcurves, querypropagationnetworks
Published: 2020-02-01 08:52:17

It turns out that we can do more today to combat climate change than ever before. With ElectraSeed Fund we’re technologists on a mission to help power-up the planet with clean energy, crowdsourcing and crowdfunding: We’re developing a curated investment pool with token engineering, some red balloons, and direct sunlight to do just that.

https://medium.com/freeelio-studios/while-davos-jet-setters-discuss-global-warming-skiing-is-still-going-downhill-964e05053bbd
Recognizing text from an image using Ruby
Tags: rails, ruby, machinelearning
Published: 2020-02-01 07:45:10

We can recognize the character's from an image using rtesseract gem and tesseract-ocr. So tesseract-ocr is an open-source OCR(optical character recognition) engine and rtesseract gem is a ruby wrapper for using tesseract-ocr.

To make rtesseract gem work we need tesseract-ocr, leptonica libraries, headers, and a C++ compiler. The tesseract-ocr gem will provide all of this. If you're on a distribution that separates the libraries from headers, remember to install the -dev package. On Debian, you will need to install libleptonica-dev and libtesseract-dev.

**Installation steps are as follows:**
First, install tesseract-ocr by using the following command **"gem install tesseract-ocr"** and check the installation by using **"tesseract --version"**.
Then install rtesseract gem that's it start using the powerful tesseract for recognizing text in an image.

*For example:*
 ```
  image = RTesseract.new('my_image.jpg', lang: 'eng') #lang is optional
  image.to_s # Getting the text value
 ```
Here RTesseract takes image URL which is required and lang is the type of language we want to scan and the default is eng - English, the "to_s" method returns the text and we can also convert the image into pdf by using "to_pdf" on the image object. It supports many more options and methods you can check it [here](https://github.com/dannnylo/rtesseract).

*The reason I used this gem because I wanted to scan a folder of images and check whether an image consists of "No image" text if yes then move the image to the "no_image" folder.* 
**So below is the ruby code of how I achieved this.**
```
require 'fileutils'
require 'rtesseract'

class ExtractNameFromImage

  def move_images_from_folder(path)
    count = 0
    Dir.glob("#{path}/*") do |file|
      image = RTesseract.new(file)
      text = image.to_s
      count += 1
      if text.include? "No Image" 
        FileUtils.mv(file, 'pathtomove') #/home/user/no_image_folder
        puts "Moved #{file} scanned #{count}"
      else
        puts "Ok #{file} scanned #{count}"
      end
    end
  end
end
puts "Scanning directory #{ARGV[0]}"
extracter = ExtractNameFromImage.new
if File.directory?(ARGV[0])
  extracter.move_images_from_folder(ARGV[0])
else
  puts "No such directory exist, try again"
end
```
Command to run this file **"ruby image_name.rb home/user/pathtoimagefolder"**.

**Conclusion:**
*Using this set up I can scan thousands of image without manually opening each of them one by one.*
lesson 13
Published: 2020-02-01 06:46:48

1. well both can either come in the beginning or end but the difference between them to is that prefix has a boolean value indicating whether the string ends ends with a specific prefix while the suffix ends with its specific suffix

2. the problem you would find is uppercase letters are for granting value to proper names or high lighting words. so to fix it is that just to type your code in lowercase but if you are gonna use words that are important or want to highlight words then uppercase them.
What are python modules that can be used to potentially write malicious code?
Tags: python
Published: 2020-02-01 06:46:41

I am trying to make a website what allows users to run python code. I've got the code part and running it down but there a matter of security too. I know that the os module and the fs module can be used to alter the actual server and this is something that shouldn't be allowed. Other than these modules, what are other modules what I can filter out and print a message to the user telling them that these keywords should not be used?