teleren/devto huggingface dataset:
Get history of past command you typed ⌨️ on terminal🐧.
Tags: commadline, tutorial, linux, terminal
Published: 2022-03-27 15:56:53

## Terminal commands are so useful,
### but what we can use out past command again and again.
### Let's find out how can we go that.

1. Arrow keys

![LikeClickArrowGIF.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1648396151082/zBQ831Xc7.gif)

```bash
⬆️ -⬇️ keys 
```
> to navigation in most recent commands 


2 .  Search in your terminal with ctrl/cmd+R

![TelescopeSpyOnGIF.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1648395896271/hsmcmA12Z.gif)

``` bash
`ctrl`/`cmd` + R
```
>when you press [`ctrl/cmd + R`](https://www.google.com/search?q=ctrl+%2F+cmd+%2B+r&tbm=isch&ved=2ahUKEwjgyeOfz-b2AhUPKbcAHaARBpwQ2-cCegQIABAA&oq=ctrl%2Fcmd+&gs_lcp=CgNpbWcQARgCMgQIABAeMgQIABAeMgQIABAeMgQIABAeMgQIABAeMgQIABAYMgQIABAYOgcIIxDvAxAnOgYIABAIEB5QvAJYvAJg6BJoAHAAeACAAWuIAdQBkgEDMC4ymAEAoAEBqgELZ3dzLXdpei1pbWfAAQE&sclient=img&ei=YYRAYqCVH4_S3LUPoKOY4Ak&bih=713&biw=1409&rlz=1C1CHBF_enIN953IN953#imgrc=L-k0jVILN-1_gM), you will see something like this.
```bash
(reverse-i-search)`': 'then type here'
```

3. See All History

![ItsHistoryYoGIF.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1648395927245/9YOqkAdSq.gif)

> to get a history of all commands
 ```bash
 history
 ```

4.  History with count

![CountingGIF.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1648395987930/XQUBnbeGg.gif)
 

```bash
history 10
```
>you will get the last 10 commands of your terminal


Thanks for your like👍🏾.

connect with me:
Twitter : [`@AbhayPrajapati_`](https://twitter.com/AbhayPrajapati_/)
Github: [`@theabhayprajapati`](https://github.com/theabhayprajapati)
Quick Review for Future Coding Age
Published: 2022-03-26 11:39:18

In the last few years, coding has become a sought after skill for many different jobs. In this post, I'm going to cover a few of the basics and tips for future coders. If you're looking to get into the field or just want to brush-up on your skills in general, then this is the post for you!

This post will show you some neat concepts, such as how code actually works and what it can do. It will also go over some more advanced topics such as debugging and design patterns that might be helpful down the line when writing code on your own.

I want to be clear that a lot of this post will be theory since I'm not a professional programmer. However, what I am about to show you are the basics for any aspiring coder and hopefully, this will help you get started on your way.

<a href="https://deepmaterialCN.com/">Link</a>

First things first, how does code actually work? Most people who have ever played around with code have likely heard of two terms: front end and back end . If you're not sure what these mean, it's okay because I'm going to explain. When writing code professionally there are generally two sides to it: the front end is what your user sees and interacts with; the back end is everything else.
A JavaScript journey: Introduction
Tags: blockchain, javascript, react, web3
Published: 2022-03-27 14:47:07

**What is this about?**
In this series of blogs, I will take you through my personal journey of learning JavaScript from my university/college project all the way to being hired as a Software Engineer (JavaScript) at one of the world's best known organisations. 

This journey was unusual in that the first time I had used JS I built a Web3 (d)app. My initial experience of programming came in Java. I am writing this primarily to help solidify some of the things I've learnt in JavaScript and also to help others who might be at the start of their journey. 

The prospective order of these blogs will follow the JavaScript apps I have built and tasks I have completed along the way. These include the blockchain dApp that I built, tasks that I completed for job applications and other courses that I have done along the way.

**A little bit about me**
I have recently graduated in Computer Science, where I was formally taught Java and SQL. As stated above, during my extended Summer project I learnt JavaScript (Node, Express, React) and Solidity.

**Why did I start with a Web3 app?**
I chose to build a Web3 app for my project while studying Computer Science. I am not a 'Web3' disciple per se, but I was curious to learn something new.

I hope that someone somewhere might find my posts useful!
DISPLAY A PDF FILE IN REACT APPLICATION WITHOUT ANY EXTRA PACKAGE.
Tags: javascript, react, googledrive, webdev
Published: 2022-03-27 14:41:52

**INTRODUCTION**

Welcome to this tutorial, here your are going to understand how to display PDF in your react application using google Drive service.
We are going to create a simple react application in which we are going to display our PDF file stored in google drive. If you don’t have a google drive account click [here](https://drive.google.com/) to create one.
Once that’s done, you have your google drive account and offcourse basic skills in react, you are able to follow this tutorial.

**CREATE REACT APP**

You can create a react application and install all the packages by your own, however you can use the `npx create-react-app <project name>` command line that installs all basics components and packages we need.

![files generated by create-react-app](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ao56hbf9ddfiyqw7hgk4.png)

**GET A PDF FILE FROM GOOGLE DRIVE**

If you don’t have a pdf file in your google drive and don’t know how to upload one click [here](https://edu.gcfglobal.org/en/googledriveanddocs/uploading-files-to-google-drive/1/) and learn how to upload a file in google drive.

Once our pdf file is uploaded in google drive click on that file to display it, then go to menu and open it in a new window.


![open PDF in new window](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uwvhxzj5rwiqcklsyxc3.png)

In the new window, click again on _menu icon_ , then to _embed item_.


![get the HMTL code by clicking to embed item](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w4dtvbqr7dit5dydsjku.png)


![HTML code to embed in react app](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/asm9pf6c18hxab1fu7ih.png)

After that, let's copy this HTML code  and past it in app.js file in our react application.


![code pasted in react-app](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tw1wok2j2py8blhegli7.png)

Here we are, let’s write `npm start` command line to run  our application.


![react app running](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/koi9qc1jem49gsfl7upr.png)

**CONCLUSION**

Now you are able to display a PDF file stored in google drive in react application without any extra package. 
_Thanks for reading_
The Weekly Dev - 202213
Published: 2022-03-27 14:34:37

---
title: The Weekly Dev - 202213
published: true
description: 
tags: 
//cover_image: https://direct_url_to_image.jpg
canonical_url: 'https://kevwe.com/weekly/202213'
---

Running your code, secure and at scale

It takes a lot of work, to build code that is theoretically able to scale globally, and apparently it takes much less to take it down, if you're not up-to-date with the latest threats and related mitigations, if only from a technical point of view.

That is - of course - only part of the story, but one we're deeply in:

https://kevwe.com/weekly/202213
Testando nossa api Go no Github Actions integrando com Codecov
Tags: go, testing, coverage, codeco
Published: 2022-03-27 14:33:26

Com todo o fluxo de testes funcional que criamos lá na [parte 2 da nossa série](https://dev.to/booscaaa/testes-unitarios-com-golang-22ph), precisamos agora botar isso para rodar sempre que algo acontecer no nosso repositório no github. Vamos configurar o arquivo `.github/workflows/test.yaml`.

```yaml
on: [push, pull_request]
name: Run test suite
jobs:
  test:
    strategy:
      matrix:
        go-version: [1.18.x]
        os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}
    steps:
    - name: Install Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ matrix.go-version }}
    - name: Checkout code
      uses: actions/checkout@v2
    - name: Download swaggo
      run: go install github.com/swaggo/swag/cmd/swag@latest
    - name: Install swaggo
      run: swag init -d adapter/http --parseDependency --parseInternal --parseDepth 2 -o adapter/http/docs
    - name: Test
      run: go mod tidy && go test ./... -coverprofile=coverage.txt -covermode=atomic

    - name: Upload coverage report
      uses: codecov/codecov-action@v1.0.2
      with:
        token: 276e28b3-208f-4012-ac00-594ff09c65a3
        file: ./coverage.txt
        flags: unittests
        name: codecov-umbrella
```

Precisamos capturar o token do Codecov para mandar o resultado dos testes, para isso vamos em [codecov.io](https://codecov.io)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q1yzb74tjmi8vstrxdt1.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zhfpvqbu7b3x3bugd4ri.png)
Capturando o token e adicionando ele no arquivo `.github/workflows/test.yaml` já podemos realizar o commit da nossa alteração e ver se tudo vai funcionar. 
Quando o actions terminar de rodar basta dar um F5 na página do codecov para observar o resultado do nosso coverage 100%.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vdb1jpb40xwzrydnmcaw.png)

## Sua vez
Vai na fé! Acredito totalmente em você, independente do seu nível de conhecimento técnico, você vai criar a melhor api em GO.
Se você se deparar com problemas que não consegue resolver, sinta-se à vontade para entrar em contato. Vamos resolver isso juntos.
Notes on Express server deployment with Docker to Heroku
Tags: docker, heroku, express, deployment
Published: 2022-03-27 14:10:14

Phew.. I ended up to spend the whole Saturday trying to deploy a very simple Express server to Heroku. [Heroku documentation](https://devcenter.heroku.com/articles/container-registry-and-runtime) looked easy at first glance, but I got many errors and needed to do research, but I finally [made the server work](https://dockertest-123456.herokuapp.com/) ([src](https://github.com/Lulkafe/DockerTest)). 

Here are my three notes about the deployment. 
I hope these can help someone save his/her time in the future.



**1. Dockerfile name needs to start with "D", not "d"**

OK: "**D**ockerfile"
WRONG : "**d**ockerfile"

For some reason, a Heroku CLI command `heroku container:push` doesn't recognize "**d**ockerfile". You will see "No images to push" error then.


**2. Use "web" as the process-type**
Ref: [Container Registry & Runtime (Docker Deploys)
](https://devcenter.heroku.com/articles/container-registry-and-runtime)

In order to build an image and push to Heroku,
the following command is directed to use.

`heroku container:push <process-type>`

For a simple web-server case like mine, 
"web" was the correct process type. 
So, this was the correct command:

`heroku container:push web`

If you are wondering where "process-type" comes from, 
here is an official documentation page:

[Dynos and the Dyno Manager](https://devcenter.heroku.com/articles/dynos)

According to it, there are three process types: "Web", "Worker", "One-off".

Since I wasn't sure what the "\<process-type\>" referred to, I typed an image tag at first. Yes, this was wrong. It was deployed on Heroku; however, it ended up in a "H14" "No web processes running" error. 

**3. Port # is given through an environment variable PORT**
Ref: [Setting the port for node.js server on Heroku](https://stackoverflow.com/questions/28706180/setting-the-port-for-node-js-server-on-heroku)
I wasn't sure how to publish a port on Heroku.
In short, we cannot freely publish any ports unfortunately.

instead, a port # is given through PORT variable by Heroku, 
and it is what the app needed to listen to.

in my case, my app checks PORT variable when it starts,
so i didn't need any modification:

`const port = process.env.PORT || 8080;`
Following an organization on GitHub
Tags: github, git, opensource, news
Published: 2022-03-27 13:16:07

Recently, I was looking for a way to track some open-source organizations and large technology companies for their contributions on **GitHub**, but unfortunately I didn't find a way to do so, but not today, while searching for new resources, I saw this 😊
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pr6080v51qx5wdk8wz9f.png)
so now you can feel free to discover what comes with it.

please feel free to share this article with friends an others.
 
[GitHub]( https://github.com/Abdeladim101Basraoui)
for more valuable resources [twitter](https://twitter.com/AbdOo57526148)
Sedekah dengan Mendamaikan Sesama!
Published: 2022-03-27 13:01:32

Kalimat puji sudah jadi mu'tabar, kita panjatkan ke hadrah Allah yang maha besar. Shalawat dan salam tercurah kepada baginda nabi Muhammad Saw. yang memelihara bendera islam terus berkibar, cahayanya bersinar. Tercurah pula kepada keluarga dan sahabat yang membela hak dan benar. Diatas mimbar, khatib wasiat senantiasa terdengar. Takwa menjadi kalimat dan kata pengantar, tali persaudaraan jangan sampai terpudar, satu sama lain jangan bersengketa dan bertengkar. فَٱتَّقُوا۟ ٱللَّهَ وَأَصْلِحُوا۟ ذَاتَ بَيْنِكُمْ Maka bertakwalah kalian kepada Allah dengan benar, damaikanlah mereka, jika bersengketa dan bertengkar. إِنَّمَا ٱلْمُؤْمِنُونَ إِخْوَةٌ فَأَصْلِحُوا۟ بَيْنَ أَخَوَيْكُمْ ۚ وَٱتَّقُوا۟ ٱللَّهَ لَعَلَّكُمْ تُرْحَمُونَ Allah maha besar, firmannya maha benar, sesungguhnya orang - orang mu'min adalah bersaudara. Satu akidah dan satu dasar. Karena itu, damaikanlah antara saudara - saudaramu, jika satu sama lain saling bertengkar. Dan bertakwalah kepada Allah, agar supaya kamu mendapatkan rahmat dengan lancar. Sumber: [https://www.penadiksi.com/2022/03/pahala-shadaqah-dengan-mendamaikan.html](https://www.penadiksi.com/2022/03/pahala-shadaqah-dengan-mendamaikan.html)
7 Helpful tools for frontend devs 🤯
Tags: javascript, productivity, css, webcomponents
Published: 2022-03-27 12:57:03

##  [AnimXYZ](https://animxyz.com/) 

So AnimXYZ will help you create, customize and animate your website!

[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dxsj4lq1muar9nqxg3zg.png)](https://animxyz.com/)

---

##  [Shaper](https://hihayk.github.io/shaper/)
 

MUST TRY!!

This interactive tool will let you play with various UI's 'LIVE' on the page!


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ywqq0byhdkw4rnewktf6.png)](https://hihayk.github.io/shaper/)

---

##  [Vizzu](https://vizzuhq.com/)
 

MUST TRY!!

Time to play with data stories 😍
This is a JS library for animated visualizations!!


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9egyspifslyv9ww6h8tz.png)](https://vizzuhq.com/)

---

 

## [Party JS](https://party.js.org/)
 

Basically, this library will help you to brighten the UX part with amazing visual effects!


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ip95drauryy0l8fh5fc.png)](https://party.js.org/)

---


 

## [Whirl](https://whirl.netlify.app/)
 

MUST TRY!!

Whirl will help you to create sick CSS loading animations with less effort!

[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t7thlojf8xwsfcwe1cch.png)](https://whirl.netlify.app/)


---

## [Theatre JS](https://www.theatrejs.com/)

Theatre JS is an animation library for high-fidelity motion graphics. It is designed to help you express detailed animation. 
It's basically a visual editor where you can animate DOM elements 🤯


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z7dtkc8btybd5rb5jbbd.png)](https://www.theatrejs.com/)

---

## [Glass UI](https://ui.glass/generator/)
 

MUST TRY!!

So, it's an online generator that lets you build a sick 'glassmorphism' effect 😍


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sev74e1o2z06tiwvd0no.png)](https://ui.glass/generator/)

---
Hope these tools will help you 🙌

Thank you! 💜

Help others find these post.
Simple Pub-Sub System using Redis and Python
Tags: python, pubsub, redis
Published: 2022-03-27 11:23:06

Hi guys i am here with an another blog post now let us build a simple publish subscribe system using python and redis

## Running the redis server 

i am using docker to start a redis instance in my computer. it's very easy to run a redis instance using docker and also it's very easy to remove redis instance, and the fun part is redis running through docker would not affect our system 😄

**running redis instance**

```bash
docker run --name demo-redis -p 6379:6379 -d redis:alpine
```

**if you want to stop or remove redis instance running through above command you can do the following**

```bash
docker container stop demo-redis # <-- stop the redis instance

docker container rm demo-redis # <-- remove the redis container
```

## Creating the publisher

```python
import redis

# initializing the redis instance
r = redis.Redis(
    host='127.0.0.1',
    port=6379,
    decode_responses=True # <-- this will ensure that binary data is decoded
)

while True:
    message = input("Enter the message you want to send to soilders: ")

    r.publish("army-camp-1", message)
```

let's think `publisher as a commander` in army and he wants to send message to the soilders so here the the topic that he wants to publish message is `army-camp-1`. this analogy is only for fun 😂

## Creating the subscriber

```python
import redis

r = redis.Redis(
    host='127.0.0.1',
    port=6379,
    decode_responses=True
)

# pubsub() method creates the pubsub object
# but why i named it mobile 🧐
# just kidding 😂 think of it as the waki taki that listens for incomming messages
mobile = r.pubsub()

# use .subscribe() method to subscribe to topic on which you want to listen for messages
mobile.subscribe('army-camp-1')

# .listen() returns a generator over which you can iterate and listen for messages from publisher

for message in mobile.listen():
    print(message) # <-- you can literally do any thing with this message i am just printing it

```

## Here is a demo video of running the above code

{% embed https://youtu.be/yMlr57Kuj1w %}



<a href="https://www.buymeacoffee.com/rohit20001I"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=rohit20001I&button_colour=5F7FFF&font_colour=ffffff&font_family=Cookie&outline_colour=000000&coffee_colour=FFDD00" /></a>
Blazor and WebAssembly
Tags: blazor, aspnetcore, beginners, codenewbie
Published: 2022-03-27 10:56:22

---
title: Blazor and WebAssembly
published: true
description: 
tags: blazor, aspnetcore, beginners, codenewbie
//cover_image: https://direct_url_to_image.jpg
---
####Introduction
In our previous [blog post](https://dev.to/sabahshariq/getting-started-with-blazor-web-development-4c7k) we learnt that with the use of Blaze web framework we can use C# for both server and client development instead of using Javascript on client side. This is possible because of usage of WebAssembly. We will now look into how Blazor leverage this WebAssembly.

####WebAssembly:
WebAssembly (abbreviated wasm) is Open Web standard which is a new type of code that can be run in web browsers. It is primarily designed to be an effective compilation target for source languages like C, C++, Rust, C# etc. on the web at near-native speed, that previously couldn’t have possible. The main goal of WebAssembly is to enable high-performance applications on web pages. This means for the blazor application to work, there is no need to recompile C# code into another language or install any special plugins like back in the days of silver light and flash.

WebAssembly code can access the full functionality of the browser via JavaScript. .NET code executed via WebAssembly in the browser runs in the browser's JavaScript sandbox with the protections that the sandbox provides against malicious actions on the client machine.

####Blazor:
Blazor is a single page application framework i.e SPA. This means .NET developers can reuse their C# skills rather than learning new JavaScript frameworks. As WebAssembly is part of all modern browsers including mobile browsers, application developed in Blazor can run natively without the need of any external plugin.

Blazor WebAssembly apps run on the browser using a .NET Intermediate Language (IL) interpreter implemented in WebAssembly. into WebAssembly. Everything that the application needs will be downloaded on to the browser and executed.

When a Blazor WebAssembly app is built and run in a browser:

* C# code and Razor files are compiled into .NET assemblies.
* The assemblies and the .NET runtime are downloaded to the browser.
* Blazor WebAssembly runtime uses JavaScript interop to handle DOM manipulation and browser API calls.

In our next blog post we will look into details on Blazor Server App and Blazor WebAssembly App [here](https://dev.to/sabahshariq/blazor-server-app-and-blazor-webassembly-app-2jhf).
Do you want a decentralized web with free speech support?
Tags: webdev, programming, discuss, blockchain
Published: 2022-03-27 10:54:48

When we use the web, every site on this web is centralized.
Where the administrators or moderators can delete, block, mute and other administratively operate on their users.

As a user, do you ever think about to have a decentralized web where no admins or moderators can do any operation on you, and you can publish any content you wish to, even it is false and offensive.

If you agree to have such a web, how would you do to realize it? which technologies will you choose?