teleren/devto huggingface dataset:
What tools and technologies do we use for Solidity Development?
Tags: javascript, webdev, programming, beginners
Published: 2022-02-22 05:19:06

From Solidity Crypto to Blockchain Solidity Solutions, we use the following technically advanced tools and technologies for the best outcomes.


**Solidity REPL **- For coding command lines on the Solidity console, our Solidity Programmers use Solidity REPL for flawless programming.


**Solgraph **-When it comes to visualizing the Solidity Control flow as well as highlighting security issues, our Solidity Engineers use Solgraph for accurate results.


**Evmdis **- To derive high abstraction rather than raw EVM operations, our Solidity Engineers leverage Evmdis to generate static analysis on the bytecode.


**Doxity **-Our [solidity developers](https://www.cronj.com/solidity-developers) uses Doxity to generate various documents for Solidity for simplified and easier documentation.


**Truffle **- For assured testing and maintaining apt asset pipelines for Blockchain using EVM, our Solidity Developers use Truffle Suite for easier development and best quality.


**MetaMask **- To streamline Ethereum blockchain interaction and allow users to access their Ethereum wallets via mobile apps and browser extensions, we use MetaMask.


**Ganache **-For easier testing, running commands, state inspection, and controlling chain operations on personal Ethereum Blockchains Our Solidity Engineers use Ganache.
Been to long..
Tags: beginners, career, codenewbie, discuss
Published: 2022-02-22 05:05:18

## If you're like me...
and you've taken a 9-12 month "Break", it's really tough to start back where you once left off. I know, I know it feels like you have to start over completely. truth if you really don't.

## Here's why!
You are more capable than you really know. I recently got back into building projects for my portfolio (I need a career change and I love this field) and JS has always kicked my ass. But now that I am back at it I feel like I've gained more from taking that break "the really long break I shouldn't have taking but you know life happens..." So your brain doesn't fully forget the concepts of certain things especially if you worked on a certain one for so long. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6h5mkoq0wozn7mohr7hj.jpg)

Don't waste your time stressing about things you have or might have forgotten, the greatest thing about programming is you don't have to know all the answers. You get to cheat and google your solutions. 

## Some Advice that will help

1. Code at least 30 mins a day or every other day.
2. Don't think you have to race through your learning.(You don't learn anything that way.)
3. Take breaks (Not long ones, I mean NOT month long ones maybe a day or two)
4. Schedule a time to sit down build something.

I usually sit down after work, even if I'm not feeling it. I say to myself okay just 30 mins that usually turns into a couple of hours or building or learning something new.

## Be consistent
I think this is what really messed me up. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ksc35giiqoohz2277hl7.jpg)
It's true being Consistent is the key.
"Wish I would have realized that in the my early 20s"..
Being good at anything in life is being consistent, Sports figures, actors, lawyers and Programmers all have one thing in common. Being Consistent.

## Figure out what is best for you
Sit down, take some notes of what has and hasn't worked for you in the past. Guide yourself, You're a Self-Taught Dev for crying out loud. Running to the new shiny toy of frameworks and languages will only dig you deeper into that hole. I know I'm just now coming out of it.

> Take all of this with grain of salt.
 
YOU know you more than I know you. so sit down and think about it. It's hard, it makes you want to cry and some point. Only because deep down you want it so bad... SO Get comfortable being uncomfortable. "Favorite Quote"
How to Install Laravel in Shared Hosting
Published: 2022-02-22 05:03:46

## What is Laravel?
Laravel is a framework based on the PHP programming language which is currently on the rise and is starting to be widely used by developers to create web-based applications.

Laravel is considered to be able to run faster, safer and dynamically so that currently many developers are starting to switch to this one framework to maximize applications on websites.

We recommend creating laravel via your localhost first. After the website has been created, you can upload Laravel to the hosting that you already have. But for those of you who just want to see the features or learn laravel, you can install laravel through hosting. Here's how to install laravel via cPanel.

## How to Install Laravel
Here we provide the steps that must be done and prepared:

1. Have an active hosting account. The recommended package used in this guide is a minimum package of Medium and above according to the [Cheap Hosting](https://cloudhebat.com) link or Cloud Hosting package
2. Login to your cPanel hosting account
3. Look for the "Softaculous Apps Installer" menu ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8v87vqym7q8rq9ruttzp.png) Then type "Laravel" in the search field then click "Install Now" 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z57usrmhjo8g9chysj6y.png)
4. Select the domain name you want to install and leave “In Directory” blank. The purpose of emptying it is so that the Laravel installation is carried out directly in the root directory, there are no other sub folders. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pk2ac8c5rya9ksswsil0.png)
5. Wait for the installation to complete.If the installation is successful, a notification like the following will appear. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nv90iu9a40kn7rk1adih.png)
6. You can also test access to the website and the results are more or less like this: 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8we19lhv3730991i70z.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84gxt9gw1k00hopqoany.png)
7. Laravel installation is complete. Then you can deploy the desired laravel on your hosting account.
一个蜜罐合约的解析
Tags: solidity, honeypot
Published: 2022-02-22 05:02:59

合约地址在:
[etherscan](https://etherscan.io/address/0xd732e40d353aa772a7f82b4b310e75925853a040)

网上的讨论地址
[reddit](https://www.reddit.com/r/solidity/comments/shgd4j/is_this_a_honeypot/)
源码如下：

```
contract defi_game {
    function Try(string memory _response) public payable {
        if (
            answerHash == keccak256(abi.encode(_response)) &&
            msg.value > 1 ether
        ) {
            payable(msg.sender).transfer(address(this).balance);
        }
    }

    string public question;

    bytes32 answerHash;

    mapping(bytes32 => bool) admin;

    function Start(string calldata _question, string calldata _response)
        public
        payable
        isAdmin
    {
        if (answerHash == 0x0) {
            answerHash = keccak256(abi.encode(_response));
            question = _question;
        }
    }
    function New(string calldata _question, bytes32 _answerHash) public payable isAdmin {
        question = _question;
        answerHash = _answerHash;
    }
    function Stop() public payable isAdmin {
        payable(msg.sender).transfer(address(this).balance);
    }

    constructor(bytes32[] memory admins) {
        for (uint256 i = 0; i < admins.length; i++) {
            admin[admins[i]] = true;
        }
    }

    modifier isAdmin() {
        require(admin[keccak256(abi.encodePacked(msg.sender))]);
        _;
    }

    fallback() external {}
}
```

分别是部署合约(constructor)，开始游戏(Start)，尝试(Try)，停止游戏(Stop)
从代码来看，整个代码就是，猜谜游戏，start出题、设置答案，Try解题，对了就转账给对的人。
从交易记录来看，出题人，一下转了2个eth进去，Try需要至少1个eth才能进行。
结果就是合约部署人，在constructor的时候把自己账号的
keccak256(abi.encodePacked(msg.sender)给设置进去

```
for (uint256 i = 0; i < admins.length; i++) {
            admin[admins[i]] = true;
        }
```

Start的时候设置问题，

answerHash = keccak256(abi.encode(_response));
question = _question;

这个地方question是一个public变量，所以你能在链上面看到问题，通过Start的参数，你可以看到答案，但是这不是真的答案，
try一下你就知道，try一下就至少一个ETH

## 本地源码部署，测试

我把合约本地部署了一下，调用参数一样，Try可以成功，套路挺深的。
所以那个源码可能不是真的源码。
反汇编代码还是挺累，所以这个坑，后面有时间再填。
如果自己要部署合约，先这样：

```
function getadmin() public {
    address addr = address(0x9BEF5148fD530244a14830f4984f2B76BCa0dC58);
    bytes32 kca = keccak256(abi.encodePacked(addr));
    emit log_bytes32(kca);//0x8d3dfe9abb5f4b094c84ab5dc2fa239c318e4985fd30286fff6150ea6963222f
}

await defi_game.deploy(["0x0000000000000000000000000000000000000000000000000000000000000020", "0x0000000000000000000000000000000000000000000000000000000000000002",
"0x8d3dfe9abb5f4b094c84ab5dc2fa239c318e4985fd30286fff6150ea6963222f"])
```

0x9BEF5148fD530244a14830f4984f2B76BCa0dC58 是 Ganache的默认账号。

只是技术探讨，大家可以交流一下。

后面又反汇编了一下代码，发现代码确实是这个。

经过群友Miller的提醒，感谢Miller，ethscan上面合约调用合约显示是有问题的
这个里可以明确看到，New调用

[另一个区块链浏览器](https://contract-library.com/contracts/Ethereum/D732E40D353aA772A7F82B4b310e75925853A040/transactions)
![16438669931.png](https://img.learnblockchain.cn/attachments/2022/02/HgvpRRk061fb6b80d3b36.png)
这样就完整了，我一直当ethscan是什么都能看到的，疑惑了几天，看来分析问题得多看几个区块链浏览器。

所以流程如下：

1，部署合约，
2，调用New设置答案hash
3，开始Start，投入2个eth
4，有人Try，投入至少1个eth
5，Stop 收入，转回自己的钱包。

后续，没讲完的
[一个蜜罐合约的解析（二）调用隐藏 | 登链社区 | 深入浅出区块链技术 (learnblockchain.cn)](https://learnblockchain.cn/article/3538)
Cash app customer service number 24 hours-get solution at once:
Published: 2022-02-22 04:55:48

Cash app user aims at getting the solution service at once if they need it. Therefore, they must know about the strategy through which they may communicate with the service team. Cash app users should have the [**Cash app customer service number 24 hours**](https://www.techjaadu.com/cash-app-support-number/) that may enable them to look for the solution by sharing the concerns with the cash app support service team.
Introducing to Python __slots__ method
Tags: python, programming, beginners
Published: 2022-02-22 04:05:18

Just came across this special method `__slots__`
According to the [Document](https://docs.python.org/3/reference/datamodel.html#slots), `__slots__` allow us to explicitly declare data members (like properties) and deny the creation of `__dict__` and `__weakref__` (unless explicitly declared in `__slots__` or available in a parent), which means we can use slots to avoid attributes to be dynamically created.

---
#### Example
When you create a class, you can access its attributes like this:
```python
class Person:
    def __init__(self,
                 first_name,
                 last_name):
        self.first_name = first_name
        self.last_name = last_name

person = Person('Chris', 'Ryan')
print(person.first_name) # Chris
print(person.last_name) # Chen
```
Also, you can easily add new attribute:
```python
person.age = 25
print(person.age) # 25
```
BUT, what if we want to prevent the attributes from being dynamically created? 
In this case, I only want my `Person` class to have *first_name* and *last_name*, two attributes. 
Try this:
```python
class Person:
    __slots__ = ['first_name', 'last_name']

    def __init__(self,
                 first_name,
                 last_name):
        self.first_name = first_name
        self.last_name = last_name

person = Person('Chris', 'Ryan')
person.age = 25
# AttributeError: 'Person' object has no attribute 'age'

```
---


#### Thanks for reading!
寫給想跳坑的 JS 新手(Part II): coding style
Tags: functional, javascript, beginners, ramda
Published: 2022-02-22 04:03:45

[圖片來源](https://betterprogramming.pub/why-i-fell-in-love-with-ramda-and-functional-programming-in-javascript-797c070133b0)

# 楔子

上一篇提到了 map filter reduce，這三個是最常見的也是最常用的使用方法，為了讓「程式碼」易讀，可以改造一下長相方便讓人看的懂在做什麼，至於怎做的就交給專業的人去優化改善就好。

所以先至少讓別人看的懂自已在寫的東西優先，試想看看，如果你是看 code 的人，「看的懂」vs 「要花一點點時間去細看」這二種，哪一種比較好讀? 先做到至少菜端出來看起來想吃，至於好不好吃就再說囉。嘿嘿嘿

# 程式碼的味道
用個最簡單的例子，把一個數字 x3 之後再 +1，但當數字是 5時就返回原值

f(1) = 1 * 3 + 1

f(5) = 5
來寫出這個 f 但我們用不同的長相來看看

## 撒尿牛丸全部攪在一起
這個應該是大部份的程式羅輯，就是把資料拆開來一個一個處理。

```
function f(x) {
   if(x !== 5) {
      return 3 * x + 1
   } else {
      return x
   }
}
```

## 點點點到天邊
這個 coding-style 就像你打開一個箱子把東西拿出來，「動作」後再放回去，依序處理。
```
let box = x => ({f: f => box(f(x)), x})
box(1)
  .f(multi3)
  .f(add1) // {f: ƒ f(), x: 4}
box(5)
  .f(multi3)
  .f(add1) // {f: ƒ f(), x: 6}

// 運算的 function 參考用
function multi3(x) {
  if(x !== 5) {
    return 3 * x
  } else {
    return x
  }
}

function add1(x) {return x+1}
```

## 按造步驟一步一步寫
這個版本和上面的版本意思差不多，就是把資料塞進去，接下來塞一堆要處理的功能。(不過也有另一派是把資料放最後，這個以後有空再討論囉)
```
let box = x => f => g => f(g(x))
box(1)(multi3)(add1) // 4
box(5)(multi3)(add1) // 6

// 運算的 function 參考用
function multi3(x) {
  if(x !== 5) {
    return 3 * x
  } else {
    return x
  }
}

function add1(x) {return x+1}
```
What is JWT?
Tags: auth, jwt
Published: 2022-02-22 03:56:08

---
title: What is JWT?
published: true
description: 
tags: auth,JWT
series: authentication
cover_image: https://res.cloudinary.com/practicaldev/image/fetch/s--RlqwldxD--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ehd9wcdwrvrn9bu5g4z5.jpg
---

# JWT's content

The JWT is a way to use token. It has three part to hold those information:

- Header. The meta information of the JWT token.
- Payload. The data about authentication. For example, the user name and the role of he/she.
- Secret. The hashed value of the header, payload, and the salt only server know.

Here is [the link to wikipedia](https://en.wikipedia.org/wiki/JSON_Web_Token).

So we can say that:

```
Secret = hashed(Header, Payload)
```

The server, which deal with the JWT token, will run the `hashed` function again and check if the secret part is same.

## Salt

As we know, that store user's password in clear text is a stupid behavior. If attacker get the database, he will use the data to attack other website (because many user use the same password and username in different website).

So a better way to hold those user's password is using hash function. But attacker will build a rainbow table ([link to wikipedia](https://en.wikipedia.org/wiki/Rainbow_table)) to attack. So we use the salt, to build it, it works well if the attacker has no idea what the salt is:

```rust
const hashed_password = hash(password, salt);
```

But we cannot avoid that attacker build the rainbow table if he know the hash function and the salt. So the best way is using **bcrypt**, **bcrypt** use random salt and hash the password again and again to add the time to get the hashed value. If attacker want to get the original password, even through he/she get the table and those salt, he/she need more time to build the rainbow tables and need build **A LOT OF** rainbow tables! It is so hard to make it, so attacker will never get the original password.
Inilah Penyebab Oli Bocor Pada Mobil Matic
Tags: bengkelmobilmedan, bengkelmobil, servicemobil, servicemobilmedan
Published: 2022-02-22 03:53:39


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/snptoc0qblcjjn5c3yt0.jpg)
Mungkin kita akan sangat kebingungan ketika oli mesin mobil kita mengalami kebocoran dan kita tidak mengetahui dari mana sumber kebocoran serta apa yang menyebabkan kebocoran pada mesin mobil kita. Namun mobil yang biasanya rutin dilakukan Service Mobil akan sangat jarang terjadi kebocoran pada mesin mobil kita, untuk itulah  sangat penting untuk kita lakukan. Dengan melakukan kita juga akan mencegah kerusakan komponen lainnya pada mobil kita. Kebocoran oli pada mesin mobil yang dibiarkan begitu saja tentu saja akan membahayakan para pengemudi mobil baik berkendara di perjalanan yang dekat ataupun berkendara di perjalanan yang cukup jauh. Sangat direkomendasikan untuk dilakukan pengecekan terlebih dahulu sebelum melakukan perjalanan jauh ada baiknya kita melakukan perawatan Service Mobil terlebih dahulu.
Hal yang menyebabkan bocornya oli pada mesin mobil adalah :

**Tidak mengganti cairan transmisi**
Cairan transmisi yang jarang diganti dapat menjadi salah satu penyebab kebocoran oli pada mesin mobil kita, terdapat petunjuk pada buku manual pemilik kendaraan dimana sangat disarankan kita untuk mengganti cairan transmisi secara berkala. Pergantian oli transmisi ini dapat tergantung pada normal atau ekstrimnya seorang pemilik mobil dalam mengemudi mobil mereka. Cairan transmisi juga merupakan salah satu komponen paling penting untuk kita rawat agar komponen mesin tidak cepat mengalami kerusakan.

**Karena kecelakaan**
Biasanya pada mobil yang telah mengalami kecelakaan dan mengenai salah satu roda gardan maka mesin mobil akan sering mengalami kebocoran oli mesin. Karena pada transmisi mobil terdapat poros diferensial atau disebut sebagai driveshafts yang memiliki 1 dan 3 poros keluaran ke roda mobil kita. Jika salah satu poros ini telah terdorong kedalam yang diakibatkan oleh kecelakaan maka dapat merusak segel dalam transmisi mobil dan menyebabkan kebocoran pada oli mesin.

**Keausan pada mesin mobil**
Terdapat beberapa komponen mesin yang telah mengalami keausan dan mengakibatkan kebocoran pada cairan transmisi, hal ini sangat wajar mengingat apabila poros keluaran yang bersentuhan dengan segel secara langsung di sekitar komponen maka akan menyebabkan gerakan yang merusak segel dan mengakibatkan kebocoran pada mesin. Perubahan suhu pada mesin juga mempengaruhi daya tahan oli seal yang juga dapat mengakibatkan kebocoran terjadi. Untuk itulah kita wajib melakukan secara rutin agar menghindari kebocoran pada oli mesin mobil.
Turn your tweets into wonderful Images for free with Capture My Tweet
Tags: twitter, productivity, showdev, design
Published: 2022-02-22 03:50:21

Now you can Turn your Tweets into Wonderful images and post them anywhere. A tons of features such as:
1. Dark/Light Mode
2. Customisable Background: Select from 50+ backgrounds and you can even download image with transparent background !
3. Download Options: Download in JPG, PNG, HD, HD+, SVG
4. Resize : Get best fit image and post them on Instagram, Facebook, Whatsapp , Linkedin, etc
5. Verification Badge is available for everyone, you can use it even if you are not verified.
6. Show or hide your Tweet Response (Like, Comment, Retweet)
7. No Watermark : You can easily remove it in one click if you don't want watermarks in your tweet images.
8. This tool is totally free and will be always free to use.
9. You can use this tool on Smartphones.

Website : [Capture My Tweet](https://capturemytweet.in)

Hope you all like this tool and support it,
Thanks 💛

Gallery :

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

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

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dso9od3mckr2n6c94lsb.jpg)
Essential Front-end Interview Questions.
Tags: html, discuss, tutorial, programming
Published: 2022-02-22 03:48:57

### 1. Why are doctypes used in HTML?

**Doctypes are not tags nor HTML elements but are document types declaration.
The documents are used or stated to tell the web browser about the html version or any markup language tha is used on the current page.**


### 2. State ways of getting elements from a dom DOM.

- getelementbyID

- getelelementbyclassname

- getelelementbyselector

- getelelementbytagname

- getelelementbyselectall


### 3. What is semantic HTML

**Semantic HTML is used to to structure content appropriately so that they are displayed properly.
  Structural content is what makes HTML pages readable. Also, properly structed content help search engnes understand web pages better and pushes the websites search rank higher.**

### 4. What are the advantages of using CSS preprocessors?

- CSS preprocessors facilitate adding variables and functions to increase code reusability.

- CSS preprocessors makes code management easier. 
It allows grouping of parent amd child elements into modular blocks. 

- Multiple stylesheets can be joined into one, using CSS preprocessors. 


### 5. List common use cases for anonymous functions

- They are  used as arguments in other functions.


- They are used to create and invoke immediate invokable function expressions.


### 6. Describe session storage.

*Session storage & Local storage.* - **as the name suggests, this data is stored until the session or tab is closed. However, it is not cleared during tab reloads.**




*Local storage* - **this data is stored on the clients computer. The data has no expiration
however, it is limited only to string data. Local data can be accessed using JavaScript and HTML but cannot be transfered to the server-end.**


## 7. What are higher-order functions.

Higher-order functions are functions that operate on other functions. They either take other functions as arguments or return them.



[Follow me on Twitter for more tips.](https://twitter.com/asapsonter)
Day 4/100, 100 Days of Code
Tags: javascript, beginners, codenewbie, devjournal
Published: 2022-02-22 03:35:36

Today was tough. I finished the second part of High-Order Functions but I was pretty lost and frustrated throughout the lesson. Might have to spend the next couple days learning about this. Also started to learn more about iterators. 

Could be a wall ahead. Time to find a way around or over it.
Crypto Arbitrage: This can make you millions
Tags: blockchain, programming, web3
Published: 2022-02-22 03:12:14

## Introduction
Crypto Arbitrage is a process through which you can make much money by swapping crypto coins
_Let that blow your mind for a while_

## Swapping
There are crypto exchange platforms like **Uniswap**, **Sushiswap** where you can swap cryptos. Let's say you have a METAMASK account with 1 ETH in it. Now, if you swap 1ETH with Dai you might get 2200 DAI. So this is what swapping is, exchange of tokens.
## How is it related to profit
The amount of DAI you get for 1 ETH is different for each platforms. For example if you get 2200 DAI for 1 ETH in Uniswap, then 1 ETH might be equivalent to 2000 DAI in Sushiswap.
### The Profit
Now, you have 1 ETH in your account, you go to Uniswap where 1ETH is equivalent to 2200 DAI. So, you have 2200 DAI in your account now.

Then you go to SushiSwap where 1 ETH is equivalent to 2000 DAI. You exchange 2000 DAI from your account for 1 ETH and still you are left with 200 DAI. That's your free profit.
## What do you need
To start this arbitrage and earn:

- Capital: You need some tokes in your wallet to do this
- Knowledge: You need to know how much you are getting for the tokens in you have in different websites
## Automation
Now there is a way to do this arbitrage automatically even if you don't have any capital.

You can make a `smart contract` and a `node server` to do this. Here's how it will work.

**Smart Contract**
- Take a flash loan
- Swap the flash loans in one Exchange where you get more of you preferred tokens
- Again swap the tokens in other exchange where its price is low
- Send the tokens widrawn from the Flash Loan and keep the rest

**Node Server**
Check the price of tokens in exchanges and according to that execute smart contract events.
Learn in Public: WCAG Principles & Guidelines - Part 1
Tags: learninpublic, cnc2022, a11y, wcag
Published: 2022-02-22 03:11:24

The Web Content Accessibility Guidelines (WCAG) is a document providing suggestions on making the web accessible for all. The WCAG offers success criteria and advice on meeting the success criteria. There are four main principles of WCAG: **Perceivable**, **Operable**, **Understandable**, and **Robust**.

For the CodeNewbie Learn in Public Challenge 2022, I will focus on these four topics and their guidelines. The goal of these posts is to share my understanding of WCAG.

Accessibility is an important aspect of the web but is treated as an after-thought. The internet has opened so many possibilities for everyone. As developers, it is our job to ensure the internet is available for everyone, regardless of their disabilities.