teleren/devto huggingface dataset:
Send notes that will self-destruct after being read | Private Note | Privnote
Tags: safenote, privatenote, securenote, privnote
Published: 2020-11-08 11:22:24

---
title: Send notes that will self-destruct after being read | Private Note | Privnote
published: true
description: Encrypt and send files and notes with a link that automatically destruct after being read. SafeNote is a free web-based service that allows you to share a note or a file with confidentiality. There is no way to spying on you even to a hacker.
tags: safenote, privatenote, securenote, privnote
//cover_image: https://direct_url_to_image.jpg
---
https://safenote.co

The idea behind SafeNote is simple, yet very powerful: sending a note that can be deleted immediately after it has been read. Remember the self-destructing messages in the Mission Impossible series? Pretty much the same thing, but without the need of becoming a wold-class spy to have this technology at your fingertips.

SafeNote’s practical interface allows you to write a message, and with a single click, a unique URL is generated. You can send this link to the person the message is intended for. When the message has been read, the link is no longer available. As a cherry on top of the pie, you receive an email when the recipient has read your message. If you want to send a file instead of a message, SafeNote also allows you to do so. Do you want to send the message to multiple recipients? You can easily configure SafeNote to determine the time the message shall be available, and during that time window, you can send the link to all the people you desire. If after 30 days the message hasn’t been read SafeNote deletes it, ensuring that your information is not stored in any way whatsoever.
About dualboot Arch + Win
Tags: systems, archlinux
Published: 2020-11-08 07:44:05

_Photo by_ [_Avel Chuklanov_](https://unsplash.com/@chuklanov?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText) _on_ [_Unsplash_](https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText)

Below are just things to remember and do when installing two OS'es. Because I'm always forgetting something and then thinking "I should've written this down as a step-by-step guide" :relieved:.

## Order matters
Always install Windows first, and then Arch. That way Win will create a boot partition and other stuff it needs. So when installing Arch you just need to create partitions for `/` and `/home`.

# Windows stuff
## Separate drives
Yes, drives `C:` and `D:` is a salvation. That way you can keep games, downloads, documents, etc. when reinstalling Win. So just do that and install Windows on drive `C:`. And `D:` will be the "storage".

## UTC time
Just do this to spare yourself from thinking "Why the Windows time is X hours behind/ahead?".

 - run `regedit`
 - navigate to `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation`
 - create new DWORD (32-bit) value named `RealTimeIsUniversal`
 - set this value to `1`

## Disable fastboot
It just messes with linux for some reason. So `Settings` > `Power` > `Advanced (or w/e) params` > `Power button actions` > Click on `Change params` > Uncheck `Enable fast boot (recommended)`.

## The case for reinstalling Windows
Before installing do all of the above, obviously. But when you reformat drive `C:` and try to install in that partition it will say something like "Not enough space on main partition". So you need to reformat `boot` partition too. Yes, it will wipe Arch bootloader but that is easy to restore.

### Restoring Arch bootloader [[rEFInd](https://wiki.archlinux.org/index.php/REFInd)]
Boot with a live cd/usb and mount `/` to `/mnt` and `/boot` to `/mnt/boot`. Then `arch-chroot` in `/mnt` and install `linux` package. Then just `refind-install`, and edit `/boot/EFI/refind.conf`. Delete unnecessary lines and change `ro` to `rw`.

Maybe, after booting change refind theme.

# Arch stuff
## Partitioning
Set EFI partition created by Win as `/boot` when creating new table. And create separate partition for `/home`, just like drives `C:` and `D:` for Win. That's pretty much it.

## `D:` aka Storage
When generating `fstab` don't forget to add Windows' drive `D:`, for example as a `/storage`.

## Installation
Just follow the [official wiki](https://wiki.archlinux.org/index.php/Installation_guide) and you're good :wink:
Quick Tip to Console-Logging Arrow Functions
Tags: arrow, function, debugging, logging
Published: 2020-11-08 10:30:16

---
title: Quick Tip to Console-Logging Arrow Functions
published: true
description: Just a short tip on how to use `console.log` in one-line arrow functions in a non-annoying way. Logging the value in one-line arrow functions can be annoying since you have to add curly braces and a return statement. Not anymore after reading this post!
tags: arrow, function, debugging, logging
cover_image: https://images.unsplash.com/photo-1523540939399-141cbff6a8d7?w=810
---
([skip to TL;DR](#tldr))

Guess what? My first Tweet "blew up"! Well, actually not really, but compared to my normal response rate of two (thanks [Arden](https://dev.to/ardennl) and [David](https://dev.to/activenode)), it was insane.

[![A picture of my Tweet which will be further described in the next paragraph of this post](https://dev-to-uploads.s3.amazonaws.com/i/3sfzilv4igpufl4prnwx.png)](https://twitter.com/OddChirp/status/1324637414258810880?s=20)
I just shared a quick-tip I, myself, learned on Twitter only a few months ago. It was about how you can wrap curly braces around a variable in your `console.log` statements to transform it to an object and have the variable name automatically prefixed as the object's key.
```javascript
const foo = 'bar', bar = 42;
console.log({ foo, bar }); // Object { foo: "bar", bar: 42 }
```
This helps to track the values in the console output easily. It basically ditches the need to add stuff like `'foo: ', foo`.
##Console Log in One Line Arrow Functions
The problem with one line arrow functions is, that if you wanna debug them with `console.log`[^debugdisclaimer], it's fairly annoying since you have to add curly braces and a return statement to it.
Let's take the following function:
```javascript
const foo = (bar) => bar.do();
```
If you want to see what's in `bar`, you commonly have to do something like this:
```javascript
const foo = (bar) => {
 console.log('bar: ', bar);
 return bar.do();
}
```
Now check this 🧙:
```javascript
const foo = (bar) => console.log({bar}) || bar.do();
```
We utilise that `console.log` always returns `undefined` (being falsey) and thus the second bit of the or operator gets executed.
No more annoying line breaks and stuff! Just add `console.log() ||` in front of your function body, and you are good to go.
## TL;DR
```javascript
const foo = (bar) => console.log({bar}) || bar.do();
```

[^debugdisclaimer]: Yeah, I know, you shouldn't debug with `console.log` hurr durr. We _still_ do it all the time.
usecase of httpie / httpie使用
Tags: python, httpie, neo4j
Published: 2020-11-08 10:24:14

Earlier this year, I have managed the development of a WebApp for industrial supplychain sourcing in our start-up . It's a typical B/S-architecture project whose server side was entirely developed by myself (Ubuntu running over AliCloud + Django + Neo4j + MongoDB + Docker + Tomcat + nginx + other dependences).

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

Below are some notes about a simple tool called **httpie** that I used for testing my APIs. These notes were taken in Chinese, however I add also simple translation in English in case someone happens to read this post and wants to understand it. 

可以使用pip安装(installing using pip with a specified source)：
```
 pip install --upgrade httpie -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
```

测试get请求(testing a GET request)：
```
    http -v GET http://127.0.0.1:8000/suppliers_server/get_user?username=qiu
```

测试POST带表单请求(testing a POST request)：
   ```
 http --form POST http://127.0.0.1:8000/suppliers_server/query_login username="qiu" password="123456"
```

测试get请求带cookie(testing a GET request containing cookie)：
   
``` 
http -v GET http://127.0.0.1:8000/corporadb/login  Cookie:sessionid=vc1d2m5kb1zul63l9g24qq5w58vfj35g
```

将token包含在header中(testing a GET request containing token)：
```
http -v GET http://127.0.0.1:8000/suppliers_server/query_chain?product=cd Cookie:sessionid=y4nokqeymk54tdapicjjkmbve1qfuheo Authorization:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InFpdSJ9.qLDaly37vl77SxyHNPEqq6_HKzbSinmPcG9GvGQ-JdQ
```
How to run Front End and Backend together in React.js and Express.js with 'concurrently' package
Tags: react, node, javascript, tradecoder
Published: 2020-11-08 10:21:17

# Run Front End and Backend Concurrently
If you are looking for a way to run Front End and Backend together with React.js and Express.js, you may simply follow these steps:

## Step 1: 
Install 'concurrently' <br/>
```
npm install concurrently --save
```
## Step 2: 
Find the script start in package.json file <br/>
By default the script looks like this
```
"start": "react-scripts start",
```
First add concurrently to that script like this with backslashes and quote marks
```
"start": "concurrently \"react-scripts start\" ",
```
Look, now if you run `npm start` it will call `concurrently` first which will run the 'react-scripts start' command and if you want to add more command you have to add the scripts (commands) like the above format with backslashes and quote marks for each scripts, let's do it in the next step

## Step 3: 
Add more scripts to concurrently. Now, if we have a backend folder with backend codes, first we need to move onto the `backend` directory (`cd backend`) (use necessary command to move onto your relevant folder), then at the same time we will call `nodemon` which will run our `server.js` file (`nodemon server`), let's do it
```
"start": "concurrently \"react-scripts start\" \"cd backend && nodemon server\"",
```
That's it. Now you can use a single command and run front end and backend concurrently from your main/root project folder. 
```
npm start
```
Why we need Code Reviews
Tags: devops, devrel, codequality, git
Published: 2020-11-08 10:19:44

I’ll start off by saying that this is more of a personal vent. I’ve not been in the coding game for too long but I’ve experienced different cultures when it comes to software engineering.

So here’s why I think we need Code Reviews - in no specific order.

##Security

Code Reviews allow us to check for any potential security issues. As systems become more complex, we all want to make it easier to ship the code or want to test a new feature and, sometimes, we let security standards slip. We might accidentally include personal credentials in the code, expose APIs or misunderstand the consequences of our code which could have security implications. 
Code Reviews allow us to work together to ensure these potential issues don't become reality.

##Quality

We all should want to produce great quality code, but we are faced with reality that it's not going to happen all the time. We are faced with combinations of deadlines, obscure requirements, growing complexity and most importantly: being human. 
Code Reviews allow our peers to let us know if the code isn't up to standards and improve it before it becomes a burden later on in maintenance.
We have all written code that we look back at and question why.

##Reflection

Knowing that our Code is going to be reviewed allows us the opportunity to reflect on what we've done. We don't want to send *bad* code to get told to redo it. 
When preparing our Code for review, we should reflect on what we've done, question if it meet the requirement(s), does the Commit messages make sense, does it meet internal/external standards, etc.

##Personal Development

Being on both sides of a Code Review - receiving and giving - has its benefits. 
As someone who's put their code up for review, we can be given knowledge and tips from others about how to improve it, told about functionality we never knew about that simplifies things, or told about the dreaded *typo* that we've totally overlooked and are now embarrassed about.
When giving the Code Review, we can learn from overlooking new code and styles which we can implement back into our own work.
Code Reviews, if done properly, enable us to learn and develop to become better.

##Teamwork

As systems grow and become more complex, we will start having less understanding of all the moving parts. We may have to use code that we never built but someone else in our team did.
Using Code Reviews, we can enable team members to share their work and give more people a better understanding of the changes being made that we might have to use or work on in the future.

👨‍💻📝👩‍💻
Competitive Coding - The Brain Sport For Coders..
Tags: programming, competitiveprogramming, braingame
Published: 2020-11-08 09:58:15

**It teaches you how to think?** If you are coder then you might understand the deep meaning of this line said by steve jobs. You might have experienced that even when you shut down your computer you keep on thinking about the code you have written in your project and then you will try to find out the solution of the problem in another way...

You know what its ultimately increase your thinking power/process. When you enter in the world of programming you not only learn coding but also the art of thinking.  

Competitive programming is the game of brain where you have to use your coding as well as your brain power.   

#### Why You should play this game? 
Programming may be a challenging role and once you enter this field you'll encounter new challenges and you'll need to solve some problems which nobody has solved before or their solution doesn’t exist anywhere. At that point you're expected to return up with an answer within the least possible time using your problem-solving and logical ability. therefore the one and clear goal behind these competitive programming is “To prepare a programmer such his/her logical ability increases and he/she is in a position to write down code for the challenging situation”.
Another reason is that big tech giants of the world that is Google, Facebook. Microsoft, Amazon hires candidate through competitive programming so if you would like to urge into these companies then you actually got to get your hands dirty in competitive programming. 

***Did you want to know how to get started with competitive programming ? then let me know in the comment section. I will write an article on it... :D***
How to reduce size of docker data volume in Docker Desktop for Windows v2
Tags: docker, wsl2
Published: 2020-11-08 09:53:42

Docker Desktop for Windows v2, which uses WSL2, stores all image and container files in a separate virtual volume (vhdx). This virtual hard disk file can automatically grow when it needs more space (to a certain limit). Unfortunately, if you reclaim some space, i.e. by removing unused images, vhdx doesn't shrink automatically. Luckily, you can reduce its size manually by calling this command in PowerShell (as Administrator):
```powershell
Optimize-VHD -Path c:\path\to\data.vhdx -Mode Full
```
The docker-desktop-data vhdx is normally in this location:
```powershell
%LOCALAPPDATA%\Docker\wsl\data\ext4.vhdx
```
Namespaces
Tags: cpp, beginners, computerscience, oop
Published: 2020-11-08 09:52:43

---
title: Namespaces
published: true
description: Using namespace in code to save typing effort
tags: cpp, beginner, computerscience, oop 
cover_image: https://images.unsplash.com/photo-1515816052601-210d5501d471?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=3264&q=80
series: Programming 101 with C++
---

Good libraries are in, what we call a **namespace**. All the things (functions and classes) in them have a full name.

Think of full name as an address that can uniquely identify a person. 

To access anything that is in a namespace, we have to use the **full name** which is typically like - 

> library name (or short form)::thing you want to use

The things in **The Standard Library (STL)** are in a namespace called **std**, which is short for standard.

> std::cout << 2 + 2 << '\n' << "Hello!";

**::** is called the *scope resolution operator*.

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

A full name **helps prevents conflicts** if you have included multiple libraries and they use the same name for some things. 

However, using the full name every time in the code can be cumbersome. To **save typing**, use a namespace or (usually better) each piece of it.

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

> using namespace std; // not so good

is an instruction to the computer that every time you see something in the code that you don't understand, **try adding 'std::' to it** and see if it helps.

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

> using std::cout; // helps documenting what is used

is an instruction to **replace all occurrences of cout in code with std::cout**.

Please leave out comments with anything you don't understand or would like for me to improve upon.

Thanks for reading!
Login with Facebook using PHP [Step by Step]
Tags: laravel
Published: 2020-11-08 09:49:00

We need to Fackbook login into many websites, it does not bother the user much, he login easily on the website and by login, we get all the data of the user like name email id age, etc. so in this tutorial, we learn Facebook login integration in PHP.


**[Login with Facebook using PHP [Step by Step]](https://www.phpcodingstuff.com/blog/how-to-login-with-facebook-in-php-with-example.html)**

```
<?php
   
   session_start();
   
   // added in v4.0.0
   require_once 'autoload.php';
   use Facebook\FacebookSession;
   use Facebook\FacebookRedirectLoginHelper;
   use Facebook\FacebookRequest;
   use Facebook\FacebookResponse;
   use Facebook\FacebookSDKException;
   use Facebook\FacebookRequestException;
   use Facebook\FacebookAuthorizationException;
   use Facebook\GraphObject;
   use Facebook\Entities\AccessToken;
   use Facebook\HttpClients\FacebookCurlHttpClient;
   use Facebook\HttpClients\FacebookHttpable;
   
   // init app with app id and secret
   FacebookSession::setDefaultApplication( 'your app ID','App Secrete ' );
   
   // login helper with redirect_uri
   $helper = new FacebookRedirectLoginHelper('http://www.phpcodingstuff.com/' );
   
   try {
      $session = $helper->getSessionFromRedirect();
   }catch( FacebookRequestException $ex ) {
      // When Facebook returns an error
   }catch( Exception $ex ) {
      // When validation fails or other local issues
   }
   
   // see if we have a session
   if ( isset( $session ) ) {
      // graph api request for user data
      $request = new FacebookRequest( $session, 'GET', '/me' );
      $response = $request->execute();
      
      // get response
      $graphObject = $response->getGraphObject();
      $fbid = $graphObject->getProperty('id');           // To Get Facebook ID
      $fbfullname = $graphObject->getProperty('name');   // To Get Facebook full name
      $femail = $graphObject->getProperty('email');      // To Get Facebook email ID
      
      /* ---- Session Variables -----*/
      $_SESSION['FBID'] = $fbid;
      $_SESSION['FULLNAME'] = $fbfullname;
      $_SESSION['EMAIL'] =  $femail;
      
      /* ---- header location after session ----*/
      header("Location: index.php");
   }else {
      $loginUrl = $helper->getLoginUrl();
      header("Location: ".$loginUrl);
   }
?>
```
Webinar: Predicting the Stock Market with Watson Studio (2nd October, 2020)
Tags: datascience, webinar, ibm, ibmwatson
Published: 2020-11-08 09:48:24

On October 2nd, 2020, Data & AI Technical Specialist Anchal Bhalla​ & UAE Cloud Developer Advocate Mridul Bhandari conducted a webinar on Forecasting the Stock Market with Watson Studio.

There were a total of 38 attendees including developers and students across MEA. The webinar started with a welcome note introducing the audience to IBM Developer Series and was divided into two primary sections, one of the sections briefing the audience about Data Science, Machine Learning & Quandl, and another section was the Code Pattern.

The first part was led by Anchal Bhalla. Anchal started it off by introducing Data Science. She then explained the difference between Data Scientist, Data Engineer & Data Analyst. It was followed by Data Science Cycle, Data Analysis types, Machine Learning, Machine Learning Process, Machine Learning Types & Quandl API. 

The second section of the webinar was conducted by Mridul Bhandari, which was towards forecasting the stock market. He started by showing the attendees how to instantiate Watson Studio on IBM Cloud and create a Cloud Object Storage. He then used the Quandl API to retrieve data from the API, imported the mined data as an asset into the Watson Studio Project, cleansed data with Data Refinery, made forecasts with IBM SPSS Software Modeler Flow, deployed the Modeler Flow Model with Watson Machine Learning, and validated the Model Stored in WML.

At the end of the webinar, the attendees were introduced to IBM Cloud Pak for Data and IBM Developer resources. Many of the attendees showed positive feedback and appreciation for the webinar.

Event recording: https://www.crowdcast.io/e/forecast-stock-market
Slides: https://mridulrb.github.io/watson-stock-market-predictor/#/
Follow along for the hands-on: https://ibm.biz/StockMarketWatsonStudioLab
GitHub Repository: https://github.com/mridulrb/watson-stock-market-predictor
Survey: https://www.surveymonkey.com/r/JHT3L8Y
IBM Cloud Sign-up link: http://ibm.biz/StockMarketWatsonStudio
Meetup page: https://www.meetup.com/IBM-Cloud-MEA/events/
qutebrowser and greasemonky script
Tags: greasemonky, qutebrowser
Published: 2020-11-08 09:43:27

---
title: qutebrowser and greasemonky script
series: 
published: true
tags: greasemonky, qutebrowser 
---

[qutebrowser](https://qutebrowser.org/) is a very spartanic but very powerful chromium based Web-Browser. The qutebrowser is a keyboard-focused browser with minimal GUI. It was inspired from browser add-ons like vimperator. But because of the minimalistic approach it lacks here and there on some convenience. Luckily we don't have to bother about addblocker, because this is build in. It is a hosts based blacklisting approach to block adds.

The main missing extensions from my side is to support greasemonky scripts. But even that is possible. But you don't have the convenient GUI like in the firefox or chrome extension. Instead you have to put your scripts in a specific directory. Under Linux the directory is located in `~/.local/share/qutebrowser`. So, if you want to use your greasemonky scripts, put your script in this directory. With `:greasemonkey-reload` you are reloading all the scripts and the will kick in, after a reload of the page.