Skip to content

Instantly share code, notes, and snippets.

View HallexCosta's full-sized avatar
:octocat:
Learning on-demand!

Hállex da Silva Costa HallexCosta

:octocat:
Learning on-demand!
View GitHub Profile
@HallexCosta
HallexCosta / openpix-sdk.js
Last active December 6, 2024 16:33
openpix-sdk.js
(() => {
window.teste = () => console.log('Hallex was here!');
})();
(()=>{"use strict";var e={521:function(e,n,t){var r,a,l,o,i,u,c=t(271),s=t(537);function d(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t<arguments.length;t++)n+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var f=new Set,p={};function h(e,n){m(e,n),m(e+"Capture",n)}function m(e,n){for(p[e]=n,e=0;e<n.length;e++)f.add(n[e])}var g=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),y=Object.prototype.hasOwnProperty,v=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\
@HallexCosta
HallexCosta / Pessimistic Lock with Atomicity: A Pragmatic Approach.md
Last active November 4, 2024 18:51
Pessimistic Lock with Atomicity: A Pragmatic Approach

Pessimistic Lock with Atomicity: A Pragmatic Approach

I want to remind you that this post does not follow a chronological order, in the future I may make two new posts, one about an optimistic lock in MongoDB and another about a comparison between the two locking models.

I will use the NoSQL database (MongoDB) together Node.js and Mongoose to explain how to work with a document lock

Enjoy reading! 😃

Summary

  • What is atomic?
  • Explain use case
@HallexCosta
HallexCosta / app.js
Last active September 4, 2024 21:05
Simple Dynamic Render List similiar to React Declarative Programming using Proxy Object in Vanilla.js
const list = document.getElementById('list')
const createCard = ({img: url, username}) => {
const div = document.createElement('div')
div.classList.add('card')
const img = document.createElement('img')
img.src = url
const span = document.createElement('span')
@HallexCosta
HallexCosta / README.md
Last active September 1, 2024 17:15
Rspack Configs for build react app from scratch (support js, jsx, ts and tsx)

Overiew

The @babel/preset-flow, animate.css, wow.js and http-server are depends not required.

Required dependencies

pnpm add -D babel-loader @babel/core @babel/preset-env @babel/preset-react @rspack/cli @rspack/core @rspack/dev-server @rspack/plugin-react-refresh react-refresh css-loader sass-loader style-loader react react-dom
@HallexCosta
HallexCosta / biome.json
Last active January 11, 2025 13:37
Biome.js configs
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"maxSize": 30000000
},
"linter": {
"enabled": true,
@HallexCosta
HallexCosta / App.js
Last active October 7, 2023 16:26
Awesome Timer
import React, { useState, useRef } from 'react';
import {
SafeAreaView,
StyleSheet,
Text,
View,
TouchableHighlight,
} from 'react-native';
@HallexCosta
HallexCosta / atalhos-ij.md
Created September 6, 2023 20:57 — forked from boaglio/atalhos-ij.md
Atalhos do IntelliJ - para quem veio do Eclipse

Atalhos do IntelliJ

Principais

Caiu no IntelliJ agora?

Aprenda só esses:

Tipo de Atalho IntelliJ IDEA
@HallexCosta
HallexCosta / problem.js
Created June 15, 2023 14:06
Simulando conflito entre timezones do EUA e BRASIL atráves de ordenação por data
const items = []
// simulate request add item using api
function api(id, date, country) {
const item = {
id,
date,
timestamp: Date.parse(date), // timestamp
country
}
items.push(item)
@HallexCosta
HallexCosta / CheckoutService.php
Last active May 8, 2023 23:43
CheckoutService.php
<?php
namespace app\modules\api\services\pagarme\orders;
class CheckoutService
{
private string $SECRET_API_KEY = '';
private array $headers;
public function __construct()
{
$username = $this->SECRET_API_KEY;
@HallexCosta
HallexCosta / gist:2490587b61a130c90f611ea942cf990e
Created April 25, 2023 17:54
Como ativar php7.4 no ec2 da amazon
https://linux.how2shout.com/how-to-install-php-7-4-on-amazon-linux-2/