teleren/devto huggingface dataset:
EVM Reverse Engineering Challenge 0x00
Tags: ethereum, evm
Published: 2024-06-26 16:43:31


It's been a while since I don't blog, so I think it's time. I've been writing an Sandwich bot, mostly in the night after work, that according to my forecast it will take me my whole life :). In case you don't know what is a sandwich bot let me tell you is not a robot that makes sandwich, that would be awesome. Just google `MEV sandwich Ethereum`, that should give you a good start. Thanks to this I've learned more and more about EVM(Ethereum Virtual Machine) in general, learning how to optimize a contract to spend less and less gas. This post is not about [MEV](https://ethereum.org/en/developers/docs/mev/) or explaining what it is, there's a lot of information about it online. Instead, is more to start doing something similar to [Reverse Engineering challenges](https://challenges.re/) by [Dennis Yurichev](https://yurichev.com/), but focus on EVM instead of traditional reverse engineering.

This blog will be the first of a series of blog, that I'll try to keep up, if laziness or another millionaire idea, like a sandwich bot, doesn't distract me. The format of the challenges will be quite simple, I'll share with you one contract addresses in the Ethereum Mainnet or TON Mainnet(not sure about this yet), the contract will have 1 USDT, your goal will be to exploit this contract and get the 1 USDT for you. Given that I'm far from being rich, I'll limit the number of challenges to 100, I hope I'll have enough material for it. After someone exploits the contract, the 1 USDT won't be in the contract removing the "incentive" for someone else to exploit the contract again. I know 1 USDT is not such a big incentive neither. Is better to be the first, you'll get a whole 1 USDT, WAOOO.

The challenges will be from easier to harder, I'll try by all means to keep it in that way, but given that I'll be also learning with this I cannot assure you that. In order to exploit this contracts is recommended that you firstly simulate your transaction, in Ethereum that can be done quite precise with [Tenderly](https://tenderly.co/), [temper](https://github.com/EnsoFinance/temper), in TON I really don't know of a good tool for that. Nevertheless this first challenge is on Ethereum. Please simulate before submitting a transaction, don't spend gas for nothing.

Enough talk, show me the stuff I want my 1 USDT!!! I'm sure this what you are thinking at the moment, you want to crack this shit and get the 1 USDT to show off with your friends. Don't worry my friend, here is the contrat address:


```
0xC3fA91C26307EA9c59334c55e23d8bf19f555Ea8
```

Feel free to exploit it, and earn that 1 USDT.

HINT: 2 + 2 = ?


PS: possible the txn will cost you more than 1 USDT, because well is Ethereum...
PROJECT ENIGMA -> NO. 1 - ZIP-ZAP (Personalized URL file sharing app)
Tags: buildspace, nws5, opensource, discuss
Published: 2024-06-26 16:43:09

Posting this as an update for Buildspace Night & Weekend S5.
Update No. 1 -> Day 1(defining of Problem) & Day 2(working out the layout)
## Problem
I constantly have the need to move files around my various number of machines. I often use cloud but as my accounts have 2FA, its takes a bit of time to login. Hence when in hurry, I often to the file transfer websites available on the web. The problem is, they have a complex way of generating there URL and hence, I have to login to my whats-app, share the link, and then download it. It beats the purpose of requiring less time. 

Hence, I am building a file sharing app in which you can decide your URL and is completely secure.

## How it works

- Enter the Domain followed by any text you like  `domain.com/{your-personalized-text}`
- If the link doesn’t exist, you can create a pin to later access the URL securely.
- If the link exist, you are required to enter the pin. Hence if you haven’t claimed the site, you should enter a different URL
- Post your files → access the same URL from another device(which shouldn’t be a problem since you set the URL yourself) → download the file on the other device
- If no device is connected to the URL, it automatically resets. Hence getting available for a new users use.
Badlucky escaped!
Tags: competition, floodescape, js13k, badlucky
Published: 2024-06-26 17:16:36

---
title: Badlucky escaped!
published: true
date: 2024-06-26 16:42:34 UTC
tags: competition,floodescape,js13k,badlucky
canonical_url: https://medium.com/js13kgames/badlucky-escaped-0bb042146106
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zu5euh70f959z61cluyv.png
---

Creating games to promote the [js13kGames](https://js13kgames.com) competition started in 2014 when [Triskaidekaphobia](https://enclavegames.com/games/triskaidekaphobia/) was released. Many years later, in 2021, we were celebrating tenth edition anniversary with [Triska Reloaded](https://medium.com/js13kgames/triska-reloaded-celebrating-tenth-edition-of-js13k-bfe78a5aa033), and now it’s time to mark the **thirteenth** edition with Badlucky level in the Flood Escape game.

[Flood Escape](https://flood.enclavegames.com/) is our ([Enclave Games](https://enclavegames.com/)) game created in 2017 which is getting regular updates - since the [inception](https://end3r.com/blog/2017/05/sick-game-jam-the-making-of-flood-escape/) we’ve added five extra levels on top of the basic three. This means the new Badlucky level is the ninth one that landed in the game in the past seven years.

![Badlucky level in Flood Escape](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/894xm6k2zh3pax6gt1zd.png)

You can unlock the new level by playing the game and collecting coins, or use the cheat code and jump directly into action:

[**flood.enclavegames.com/?cheatcode=Badlucky**](https://flood.enclavegames.com/?cheatcode=Badlucky)

This level is clearly inspired by Triska Reloaded, but adjusted to the style and gameplay of Flood Escape - check it out and let us know if you like it!

* * *
Troubleshooting CORS Issues in Express.js: A Simple Misconfiguration
Tags: cors, backend, node, express
Published: 2024-06-26 16:36:11

Recently, while working on a Cross-Origin Resource Sharing (CORS) issue, I encountered a perplexing problem. Despite using the `cors` package with Express.js, my API was not sending the `Access-Control-Allow-Origin` header. This is a common issue developers face, so I decided to share my experience and solution.

### The Initial Configuration

Here’s what my initial CORS configuration looked like in my Express.js application:

```js
app.use(cors({
    origin: "https://domain-a.com/"
}));
```

### The Problem

Given the above configuration, I expected that requests from `https://domain-a.com` would be allowed. By default, the `cors` package allows all HTTP methods. However, while the API was correctly sending the `Access-Control-Allow-Methods` headers, the `Access-Control-Allow-Origin` header was conspicuously absent. This resulted in the infamous CORS error message in the browser.

### Diagnosis and Troubleshooting

Initially, I was confident that my configuration was correct. The domain matched, and there were no apparent issues with the setup. However, the error persisted. After several attempts to debug the issue, including:

- Verifying the request headers
- Ensuring the server was running correctly
- Double-checking the `cors` package documentation

I still couldn’t pinpoint the problem.

### The Discovery

After much trial and error, I finally discovered the issue. As trivial as it may seem, the problem was with the trailing slash in the `origin` configuration. The `origin` should have been `https://domain-a.com` instead of `https://domain-a.com/`.

```js
app.use(cors({
    origin: "https://domain-a.com"
}));
```

### The Solution

By simply removing the trailing slash, everything started working as expected. The API correctly sent the `Access-Control-Allow-Origin` header, and the CORS error disappeared.

### Conclusion

This experience taught me a valuable lesson: sometimes the simplest mistakes can cause the most frustrating issues. When dealing with CORS configuration in Express.js (or any framework), ensure that the `origin` parameter is precisely specified without unnecessary characters like trailing slashes.

Here’s the corrected CORS configuration for reference:

```js
app.use(cors({
    origin: "https://domain-a.com"
}));
```

This minor adjustment made all the difference, resolving the issue and allowing my application to function correctly across different domains.

### Key Takeaways

- Always double-check your CORS configuration, especially the `origin` parameter.
- Even small mistakes, such as a trailing slash, can lead to significant issues.
- Don’t be afraid to revisit the basics when troubleshooting complex problems.

I hope this helps others who might face similar CORS issues. Happy coding!
Orangeville Tree Service
Tags: treeservices, treecare, treeremoval, treetrimming
Published: 2024-06-26 16:32:45

Orangeville Tree Service employs certified arborists to maintain the health and beauty of your trees. [Tree Services Orangeville ON](https://www.orangevilletreeservice.ca/) offer services like trimming, removal, and stump grinding, ensuring the job is done efficiently and safely, prioritizing customer satisfaction in Orangeville, Ontario.

Contact us at +1 (226) 455-8286 or info@orangevilletreeservice.ca

Services

Tree Removal
Tree Trimming
Stump Removal

Monday - Sunday Open 24 Hours
🌟 Project 2: Nike Product Card - Part of My 50 Projects Challenge 🏆
Tags: webdev, javascript, beginners, programming
Published: 2024-06-26 16:31:06


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/27l1jac5zw8md544wlun.jpg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aioscrbnhlehknxq88hj.jpg)
Hello dev.to community! 👋 I'm excited to share the second project of my 50 projects challenge. This project is a stylish Nike product card built using HTML, CSS, and JavaScript. Let's dive into the details of this project! 🎉

🚀 Project Overview
The Nike Product Card is a modern and interactive card design that showcases a Nike shoe. It includes various elements such as the Nike logo, shoe images, product details, and interactive features. 🏃‍♂️👟


🛠️ Technologies Used
HTML: For structuring the content
CSS: For styling the card and making it visually appealing
Behind `NoInfer` in TypeScript
Tags: typescript
Published: 2024-06-26 16:23:33

**Disclaimer**: As of now, I have not found documentation that explicitly supports the type inference mechanism discussed in this article. This is based on my understanding and experience with TypeScript. Readers are encouraged to explore further and refer to the official TypeScript documentation for additional information.

## TL;DR

The `NoInfer<T>` utility type in TypeScript blocks type inference, ensuring types are matched explicitly. It works by using a type parameter T in a way that prevents automatic type inference. 

## `NoInfer` - the New Utility Type

I recently came across an awesome [video](https://youtu.be/QSIXYMIJkQg?si=bfmy0VaRT5Y2HfrJ) and [article](https://www.totaltypescript.com/noinfer) by Matt introducing the `NoInfer` utility type and its mechanism.

According to Matt's article and video, a self-implemented version of `NoInfer` is:

```typescript
type NoInfer<T> = [T][T extends any ? 0 : never];
```

I wondered why this works?

## Dive in with Examples

I asked my friend Jiar, and he explained that it has to do with TypeScript's type inference mechanism. What `NoInfer` does is to block the type inference. He gave me [this example](https://www.typescriptlang.org/play/?ts=5.0.4&ssl=16&ssc=2&pln=1&pc=1#code/C4TwDgpgBAcg9gSQHYDMICcA8AVAfFAXigG1sBdUqCAD2AiQBMBnKAQyRCgH4oAGKAFxQkEAG4YyAbgBQ0lAFckAY2ABLOEih0mweMjRZsVWvWZQd6VUgDmuABSt01pkOzEyAGmGJUGAIJOLrA+Bji4AJRCAEZwcAA2EOxQAN7SUOlQ6BDA8uiajs4AdFZKcfIMEEx2SCH+geEyAL6y2rq16HZpGcQA5AnATD1ePdZwPZ5d6QD0AFQzUAACAwC0NJAqq+jocOhQM1OTUD1McAC2EADuABZZPdINLZVt+hidGSQ9kHBgCUNHVxA4mBxh5Dp8IN9fqDwkA):

```typescript
type NoInfer<T> = [T][T extends any ? 0 : never];

function testNoInfer<T extends string>(args: T[], noInferArgs: NoInfer<T>): boolean {
    return args.includes(noInferArgs);
}

testNoInfer(
    ['lets', 'go'],
    /** @ts-expect-error */
    'somewhre'
);

testNoInfer(
    ['people', 'help'],
    'people',
)
```

### Does the Order of the Parameters Matter?

To understand what "blocking" means, let's change the order of the parameters in the `testNoInfer` function:

```typescript
function testNoInfer<T extends string>(noInferArgs: NoInfer<T>, args: T[]): boolean {
    return args.includes(noInferArgs);
}

testNoInfer(
    /** @ts-expect-error */
    'somewhre',
    ['lets', 'go'],
);

testNoInfer(
    'people',
    ['people', 'help'],
)
```

You see, the order doesn't matter-- it still works.

### A Flash of Inspiration

What if we leave the `noInferArgs` argument alone?

```typescript
function testNoInfer<T extends string>(noInferArgs: NoInfer<T>): boolean {
    return Boolean(noInferArgs);
}

testNoInfer(
    'somewhre'
);

testNoInfer(
    'people'
)
```

No error! I knew it! The type `NoInfer` is just the type parameter `T` itself!

So why does defining the other parameter change everything?

## Conclusion

In my opinion, the "block" occurs because TypeScript checks the `args` with plain `T` and then references this `T` in the NoInfer type. Therefore, when another parameter is defined with plain `T`, TypeScript insists that `T` should match what `args` received.
Rails Migration Tips and Examples (not a full step by step)
Tags: migration, ruby, database, generate
Published: 2024-06-26 16:21:43

Generates the model and migration, but also all of the RCAVs for index, show, create, update, and destroy.
- The model name must be singular.
- Separate column names and datatypes with colons (NO SPACES).
- Separate name:datatype pairs with spaces (NO COMMAS).
```
rails generate draft:resource <MODEL_NAME_SINGULAR> <COLUMN_1_NAME>:<COLUMN_1_DATATYPE> <COLUMN_2_NAME>:<COLUMN_2_DATATYPE> # etc

EX:
rails generate draft:resource board name:string
        OR
rails generate draft:resource post title:string body:text expires_on:date board_id:integer
```

Execute the generated migrations with:
```
rake db:migrate
```

This will remove all the files that rails generate draft:resource post ... had previously added. You can then correct your error and re-generate from scratch.
```
rails destroy draft:resource post
```

If you made a mistake when generating your draft:resource AND you’ve already run rake db:migrate, then first you have to run the command:
```
rake db:rollback
```

Adding and Removing columns
```
Ex:
rails g migration AddImageToPosts
    OR
rails g migration RemoveExpiresOnFromPosts
```

- If your database gets into a weird state (usually caused by deleting old migration files), your ultimate last resort is
- This will destroy your entire database and all the data within it. Then, you can fix your migrations and re-run all from scratch with rake db:migrate, then rake sample_data to recover the sample data.
```
rake db:drop
```
Continuacao Fundamentos Java
Published: 2024-06-15 02:24:21

**Programação orientada a objetos**
A programação orientada a objetos (OOP) é central para Java, que adota essa metodologia para lidar com a crescente complexidade dos programas, organizando-os em torno de dados e não apenas de código, e utilizando conceitos-chave como encapsulamento, polimorfismo e herança para criar uma estrutura de programação mais clara e eficaz.

**Encapsulamento**
O encapsulamento é um mecanismo na programação orientada a objetos que une código e dados em um único bloco seguro contra interferências externas, criando objetos que escondem seus detalhes internos e expõem apenas uma interface controlada através de classes, que definem a estrutura e o comportamento desses objetos.

**Polimorfismo**
O polimorfismo é uma característica da programação orientada a objetos que permite que uma única interface acesse diferentes ações específicas, dependendo do contexto, facilitando a reutilização de código e simplificando a complexidade ao permitir o uso de uma interface genérica para várias operações relacionadas.

**Herança**
Herança é o processo que permite que um objeto adquira as propriedades de outro objeto, facilitando classificações hierárquicas onde objetos mais específicos herdam características de objetos mais gerais, reduzindo a necessidade de definir repetidamente atributos comuns e permitindo que cada objeto se concentre apenas em suas características únicas.
Improving Efficiency in Defect Resolution - Your Input Needed
Tags: productivity, softwaredevelopment, defectresolution, debugging
Published: 2024-06-26 16:03:53

##👀 Are you or your team spending more time debugging defects than building game-changing features?

I'm on a mission to **bridge the gaps** holding us back. I’m creating a program to boost efficiency and effectiveness in defect resolution. But I need YOUR insights to ensure it delivers the greatest value.

###📝 [Join our quick survey and be a catalyst for change](https://lnkd.in/d5VDD3gd): 
**Reasons to participate:**
* Help improve industry practices
* Gain insights from the collective data
* Be a part of a growing community focused on improvement
* **First 20 respondents receive a 50% discount voucher** on my upcoming course!

###🔗 Help us reach more professionals!
If you know someone who would have valuable insights, please share this post with your network. The more perspectives we gather, the better we can tailor our course to meet the needs of the community.

###🌟 Thank you for your time and valuable input!
Your feedback is greatly appreciated and will directly contribute to better strategies and solutions for effective and efficient defect resolution and debugging.

Feel free to drop any further comments or questions below.
How to Install Devise
Tags: devise, users, programming, ruby
Published: 2024-06-26 16:15:20

Use Devise for Users

Install
```
rails generate devise:install
```

Change :delete to :getin devise file
```
# config/initializers/devise.rb, Line 269

config.sign_out_via = :get
```

Set a root route in routes
```
# config/routes.rb

root "boards#index"
```

Use our new generator supplied by the gem to create the User model and routes
```
rails generate devise user
```

Then Migrate
```
rake  db:migrate
```
Day 30 of my progress as a vue dev
Tags: webdev, vue, typescript, tailwindcss
Published: 2024-06-26 16:05:42

**About today**
Today was a decent day,I ended up finishing my last landing page and spent a decent amount of time working on my job project so I think it was satisfactory.

**What's next?**
I will be ending this series here as it sort of got a little directionless and did not entirely serve the purpose I started it for. It ended up becoming a series on productivity rather than about progressing as a vue dev. Although it wasn't a complete waste I did learn a lot of new things about development and doing things in a productive manner and I believe it will help me in the future. I will be starting a new series from tomorrow with the intent of learning new technologies and techniques regarding web development in general with the aim to learn something new everyday and document it over here.

**Improvements required**
I need to pace my consistency and avoid being lazy when it comes to trying new things. I just started my journey and I still have a very long way to go. I learned a lot during this attempt of mine and I believe I will be learning a lot more in the future.

Wish me luck!
[DAY 63-65] I built a markdown previewer using React
Tags: learning, react, javascript, webdev
Published: 2024-06-26 16:00:00

Hi everyone! Welcome back to another blog where I document the things I learned in web development. I do this because it helps retain the information and concepts as it is some sort of an active recall.

On days 63-65, after completing the first project in the Front End Development Libraries course, I moved on to the second one called “Markdown Previewer”.

It is a program that allows you to input text in the textarea element and it will render it as HTML code in the webpage.

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

How I did it is first, I did the plain HTML of the program. I used React because I want to practice my React skills. 

I added 2 div containers. One for the textarea element where you input your text. And another for an element where it renders your code as HTML.

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

Next, I moved straight to adding the functionalities to fulfill the user stories. I first initialized a state input and created functions to handle event changes in the textarea, as well as render the inputted text as HTML code to the webpage. I used the marked library given by the course in the user stories so that there's no need to parse my own. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xqkbhqz1zfbd3gyfppcu.PNG)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bb6em4fvh2po2n8lr9la.PNG)

After that, I set an attribute to my div container named dangerouslySetInnerHTML to convert the inputted texts as HTML code. This is paired with the function I made earlier where I used the marked library. 

Lastly, I finalized the design using vanilla CSS to make it look good. 

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

Overall, the project was short and easier than the previous one named “Random Quote Machine”. I still feel good and satisfied with what I made since at this point, every project small or large is a good practice for me. So, I'll take this as another win for the week.

Anyways, that’s all for now, more updates in my next blog! See you there!
TIL: The Basics of GitHub
Tags: webdev, beginners, todayilearned, github
Published: 2024-06-26 15:56:05

> "Every morning we are born again. What we do today is what matters most." — Buddha

When I began writing blog posts earlier this year, I would start off with a quote that reflected my current outlook on life. I think it would be a good idea to continue that tradition here.

Today I learned how to store a static webpage on GitHub. GitHub is used to store code, and keep track of the revisions made to your files. I feel like this will be very useful for collaborating with others.

In addition, I used Codespaces, which is a cloud code editor that is based on VSCode. I was relieved when I saw this because the only code editor I had experience with before this apprenticeship was VSCode. So I felt right at home with Codespaces

After creating a simple "Hello world!" webpage, I deployed the app by using Render. Render is a hosting provider that allows your page to be viewed by anyone. 

I had to plug this code into my Codespace in a new file called 'render.yaml'

```
services:
  - type: web
    name: hello-world
    env: ruby
    plan: free
    buildCommand: "./bin/render-build.sh"
    startCommand: "./bin/render-start.sh" 

```

After doing this and creating a blueprint, I went back to GitHub Pages to deploy my site! I know it's not much, But i feel like this will be a milestone that I will look back on!