Skip to content

Commit

Permalink
feat(blog): use velite file handler for handle post images
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusfg7 committed Feb 26, 2024
1 parent d5df658 commit 6212fa3
Show file tree
Hide file tree
Showing 22 changed files with 84 additions and 170 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ yarn-error.log*
.obsidian
.env
.velite
public/static
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -46,35 +46,35 @@ test: true
### Width 100px

<img
src="https://2.bp.blogspot.com/-B7951Pnxrsk/V12Jlk-7yWI/AAAAAAAAnPA/Y0lS0NHADDoAztXWmkzZe411XLtRmEJvwCLcB/s1600/bem%2Bvindo%2Bao%2Bmundo%2Bdas%2Bgambiarras%2Bsacanas.gif"
src="assets/bem+vindo+ao+mundo+das+gambiarras+sacanas.gif"
width="100"
/>

### Width 300px

<img
src="https://2.bp.blogspot.com/-B7951Pnxrsk/V12Jlk-7yWI/AAAAAAAAnPA/Y0lS0NHADDoAztXWmkzZe411XLtRmEJvwCLcB/s1600/bem%2Bvindo%2Bao%2Bmundo%2Bdas%2Bgambiarras%2Bsacanas.gif"
src="assets/bem+vindo+ao+mundo+das+gambiarras+sacanas.gif"
width="300"
/>

### Width 560px

<img
src="https://2.bp.blogspot.com/-B7951Pnxrsk/V12Jlk-7yWI/AAAAAAAAnPA/Y0lS0NHADDoAztXWmkzZe411XLtRmEJvwCLcB/s1600/bem%2Bvindo%2Bao%2Bmundo%2Bdas%2Bgambiarras%2Bsacanas.gif"
src="assets/bem+vindo+ao+mundo+das+gambiarras+sacanas.gif"
width="560"
/>

### Width 1000px

<img
src="https://2.bp.blogspot.com/-B7951Pnxrsk/V12Jlk-7yWI/AAAAAAAAnPA/Y0lS0NHADDoAztXWmkzZe411XLtRmEJvwCLcB/s1600/bem%2Bvindo%2Bao%2Bmundo%2Bdas%2Bgambiarras%2Bsacanas.gif"
src="assets/bem+vindo+ao+mundo+das+gambiarras+sacanas.gif"
width="1000"
/>

### Width 2000px

<img
src="https://2.bp.blogspot.com/-B7951Pnxrsk/V12Jlk-7yWI/AAAAAAAAnPA/Y0lS0NHADDoAztXWmkzZe411XLtRmEJvwCLcB/s1600/bem%2Bvindo%2Bao%2Bmundo%2Bdas%2Bgambiarras%2Bsacanas.gif"
src="assets/bem+vindo+ao+mundo+das+gambiarras+sacanas.gif"
width="2000"
/>

Expand Down Expand Up @@ -581,7 +581,7 @@ Text: [var]

## Image

[image]: https://external-content.duckduckgo.com/iu/?u=http%3A%2F%2Fwww.steves-digicams.com%2Fblog%2Fwp-content%2Fuploads%2F2017%2F10%2FNikon_D850_Sample_13.jpg&f=1&nofb=1
[image]: assets/bem+vindo+ao+mundo+das+gambiarras+sacanas.gif

![image with sample image][image]

Expand Down
13 changes: 0 additions & 13 deletions content/posts/js-promises.mdx

This file was deleted.

Binary file removed content/posts/learn-with-ethereum/image.jpg
Binary file not shown.
26 changes: 7 additions & 19 deletions content/posts/learn-with-ethereum/learn-with-ethereum-ep2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,11 @@ status: 'published'
[workflow 10]: https://sandbox.eth.build/wofCrGxhc3Rfbm9kZV9pZMONAcKlxIHEg8SFbGlua8SLxI0BwoLCpcSHxIlzwpvCisKixIzEjmjCpHR5cGXCq0NyxKh0by9IxINowqNwb3PCksOMwoPDjMKwwqRzaXplwpJ4HsKlZsSCZ3PCgcKpY29sxIJwc2Vkw4PCpW9yxIlyBMKkbcSIZQDCpsSVcHV0c8KRwoPCpG5hbWXCpcWixaTEpsSoZcKtxIRyxJVnLG51bWJlcsKkxJTElsSOScKnb8WkxaPFpcWnxanFq2XCpGjEs8WxxKnCpsW1xbfCpcaBa8WmxI5Lwqpwcm_EqXJ0aWVzwoDEocSjAWnGkWXCqkluxogvVGV4dMS1xLfEucKBdcS-xYDFgsSOLDLFhsWIxYr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qXGq8Kwz5DPksSCz5XIk3RBzYthy7RaxI4iz6DEjsK4w4zClc-lyLvQqnIF0K3Jp8aKz7vKtc2AzpHPsM6g0LnPuMq8zo_Nj82CxI7Cg9CDy43Qhcuay5LRt9G5y4XLpcKhyKHLqsSvL0Vuya3Iq8a3yK7CisSOXs-gw4zIttKFzIcI0orKs8y4zpbLlcy90L7SkMmjzYXKqcKnzorOjMyf0r7Joc6SAX3Pt8WlzI3Pu8myybTJtsmPybPJtWPJt9GKzbvJm8ipyIZk04fLiM2DftKbxqTGptGuAcKfxqvGrcqnxrHGs9KsyK0BSsSOw77SgAHGv9Ckx4TKnMqeZMqg0ocC0rjKqNKNx5bOh9OM0K_Hn9Oe0pjTitOic8ewx7LHtMe2Zce4xYHHus-Tx77IgM6xxb7Ig8iFyIfIiXTIi8iN0IbQiMKk0bfIlciXyJnCuNGYz5Eg1KjRjGLPs8iRIMWSyKjNnCDLiMKawpbGg8SOaQDEpADFtM6QxbjKvsW9ctS2AUvUu8SOa8WgyaDVg2zVh9S6AcKO1YnUvtWDbcSO1ZDEjsKQAADVg3vKg9WOwp4Cw7_Vg33EjsKf1Y7CoQHSj2fVg37EjtWnxI7CntWo1YrEjn_VhwHVrdWRzLPVg8KCxI7Co9WOwqXVuMW31YPCg9Gv1Y7CjtWx1L7CpmfGnnXFkcKQwqbFjW5maWfCgMKndsW-xL9vbsOLP8OZwpnWn9afwpo

{/* IMAGES \ */}

[screenshot_10]: https://i.ibb.co/6Yfkjx7/screenshot-10.png
[screenshot_11]: https://i.ibb.co/bWRqz1h/screenshot-11.png
[screenshot_12]: https://i.ibb.co/0tHZS7d/screenshot-12.png
[screenshot_13]: https://i.ibb.co/yVxpL06/screenshot-13.png
[screenshot_14]: https://i.ibb.co/k3HGLG5/screenshot-14.png
[screenshot_15]: https://i.ibb.co/GcHzZfQ/screenshot-15.png
[screenshot_16]: https://i.ibb.co/hHF1bsr/screenshot-16.png

{/* IMAGES \ */}

{/* VARIABLED BLOCK */}

## Encryption (side quest)

![/assets/learn-with-ethereum/screenshot_10.png][screenshot_10]
![/assets/learn-with-ethereum/screenshot_10.png](assets/screenshot_10.png)
[_click here to edit this workflow on eth.build_][workflow 5]

disclaimer: Todos esses blocos ja são conhecidos portando não vou reexplica-los, se quiser revisar veja o [primeiro post](/post/learn-with-ethereum) da série.
Expand All @@ -43,7 +31,7 @@ O legal desse workflow é pra notar algo, o endereço gerado pelo **KEY PAIR**.

### Encrypt a message

![/assets/learn-with-ethereum/screenshot_11.png][screenshot_11]
![/assets/learn-with-ethereum/screenshot_11.png](assets/screenshot_11.png)
[_click here to edit this workflow on eth.build_][workflow 6]

O bloco **ENCRYPT** é o bloco que consegue criptografar uma mensagem usando uma _public key_, ele recebe como parâmetro a _public key_ e a _message_. Semelhante ao funcionamento da criptografia [PGP](/posts/pgp).
Expand All @@ -58,7 +46,7 @@ E devolve a mensagem criptografada: `0xabc62f77ba4447a16825e10764687a9902f5bc3c0

### Decrypt a message

![/assets/learn-with-ethereum/screenshot_12.png][screenshot_12]
![/assets/learn-with-ethereum/screenshot_12.png](assets/screenshot_12.png)
[_click here to edit this workflow on eth.build_][workflow 7]

O bloco **DECRYPT**, como o próprio nome diz, faz o inverso do bloco **ENCRYPT**. Ele recebe como parâmetro a _private key_ e _encrypted_ (a mensagem criptografada no bloco **ENCRYPT**).
Expand All @@ -69,26 +57,26 @@ Este bloco devolve como retorno a mensagem inicial descriptografada (`"hello wor

### Full Encrypt/Decrypt Workflow

![/assets/learn-with-ethereum/screenshot_13.png][screenshot_13]
![/assets/learn-with-ethereum/screenshot_13.png](assets/screenshot_13.png)
[_click here to edit this workflow on eth.build_][workflow 8]

### Publish/Subscribe messages

![/assets/learn-with-ethereum/screenshot_14.png][screenshot_14]
![/assets/learn-with-ethereum/screenshot_14.png](assets/screenshot_14.png)
[_click here to edit this workflow on eth.build_][workflow 9]

O bloco **PUBLISH** serve pra enviar uma determinada mensagem em uma rede, tipo um canal [IRC](/posts/irc) (no caso a rede padrão é network.eth.build). E o bloco **SUBSCRIBE** é o bloco que recebe a mensagem. A cada envio no **PUBLISH** o **SUBSCRIBE** recebe automaticamente, de qualquer um que enviar uma mensagem.

#### Encrypt messages on the network

![/assets/learn-with-ethereum/screenshot_15.png][screenshot_15]
![/assets/learn-with-ethereum/screenshot_15.png](assets/screenshot_15.png)
[_click here to edit this workflow on eth.build_][workflow 10]

Aqui podemos combinar os blocos **ENCRYPT** e **PUBLISH** para enviarmos uma mensagem criptografada na rede. E depois obtermos a mensagem criptografada com o **SUBSCRIBE**: `0xf0565fb9b8d0ce71b5886c71dfad9803020bd4e8329e66b63b93703283f6e6dbae5c181458a166966a5a70bedc96f3f3ad52261ab619ee312ff5979af11cc4f0eeb0c9af9baeb6b3dd66af72c97a371482066a5cd40e11bf24d4f469416b27831c03189b3e07b3c5a8044ca95392b1d5c9`

#### Decrypt messages on the network

![/assets/learn-with-ethereum/screenshot_16.png][screenshot_16]
![/assets/learn-with-ethereum/screenshot_16.png](assets/screenshot_16.png)
[_click here to edit this workflow on eth.build_][workflow 11]

Combinando o workflow anterior com o bloco **DECRYPT** conseguimos descriptografar a mensagem enviada na rede.
Expand Down
Loading

0 comments on commit 6212fa3

Please sign in to comment.