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 / skill-icons.json
Last active January 20, 2025 18:59
Testing
{
"ableton": {
"alias": [
"ableton",
"dark:ableton",
"light:ableton",
"test"
],
"themes": [
"dark",
@HallexCosta
HallexCosta / openpix-sdk-cofiguration.js
Last active December 6, 2024 16:50
openpix-sdk-cofiguration.js
console.log(window.$openpixSDK)
window.$openpixSDK.addEvent('beforeCreateCharge', async (nextFn, products, productId) => {
console.log('beforeHook inside Called')
console.log({ nextFn, products, productId })
const order = await createOrderWC(products.get(productId))
if (!order) {
return
}
@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)