Skip to content

Instantly share code, notes, and snippets.

View wallace-sf's full-sized avatar
🏠
Working from home

Wallace Ferreira wallace-sf

🏠
Working from home
View GitHub Profile
@wallace-sf
wallace-sf / gist:ace5f27e08b7cdbeb387bc2c9bb55ea4
Created October 21, 2023 23:51
payload refresh endpoint
{
"AccessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJZFBvcnRhbCI6MCwiSWRVc3VhcmlvIjoxLCJJZGlvbWEiOiJwdC1CUiIsIklzU3VwZXJ2aXNvciI6ZmFsc2UsIk1lbnUiOltdLCJQZXJtaXNzb2VzIjpbeyJJZE1lbnUiOiJBRE1ESVNUUklCIiwiSW5kUG10RWRpdGFyIjoiUyJ9XSwiVGlwbyI6IkEiLCJleHAiOjE2OTc5MzI5ODJ9.NX8fpfNDQ8J9kKhFSc6iIC8Und6e2cnuHk3uGzaI-Is",
"RefreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJZFBvcnRhbCI6MCwiSWRVc3VhcmlvIjoxLCJJZGlvbWEiOiJwdC1CUiIsIklzU3VwZXJ2aXNvciI6ZmFsc2UsIk1lbnUiOltdLCJQZXJtaXNzb2VzIjpbeyJJZE1lbnUiOiJBRE1ESVNUUklCIiwiSW5kUG10RWRpdGFyIjoiUyJ9XSwiVGlwbyI6IkEiLCJleHAiOjE2OTc5MzU2ODJ9.GyEpEQBVhOPPuSopZEjyp5nvJXwf-igmZBWvzW3rUSY"
}
@wallace-sf
wallace-sf / curryingMyComponent.ts
Last active February 20, 2022 22:28
Currying component with Typescript
export type CurryMyComponentProps = (
component: React.FC<MyComponentProps>
) => (
props: React.PropsWithChildren<MyComponentProps>
) => React.ReactElement | null;
export const curryMyComponent: CurryMyComponentProps = (component) => (props) => {
/*
Other stuff here...
*/
@wallace-sf
wallace-sf / isCyclic.js
Last active May 4, 2022 20:45
Check if field name is in a cyclic object map
/**
* @description check if field name is in a cyclic object map
* @author Wallace Ferreira <https://github.com/wallace-sf>
* @example
* ```js
* var mapA = {
* a: ['b', 'c', 'd', 'e'],
* b: ['c', 'd'],
* c: ['d'],
* d: ['f', 'a'],
@wallace-sf
wallace-sf / getRelativePath.js
Last active February 10, 2022 19:46
getRelativePath util for lodash `get` function
/**
* @param {string} [path='']
* @return {boolean}
* @author Wallace Ferreira <https://github.com/wallace-sf>
* @example
* isRelativePath('.')
* => true
* isRelativePath('..')
* => true
* isRelativePath('a...')
@wallace-sf
wallace-sf / localeText.js
Created December 13, 2021 19:12
AG_GRID_LOCALE_PT_BR
const AG_GRID_LOCALE_PT_BR = {
// Set Filter
selectAll: '(Selecionar tudo)',
selectAllSearchResults: '(Selecionar todos os resultados da pesquisa)',
searchOoo: 'Pesquisando...',
blanks: '(Em branco)',
noMatches: 'Nenhum resultado encontrado',
// Number Filter & Text Filter
filterOoo: 'Filtrando...',
@wallace-sf
wallace-sf / Exemplo de spec de Wizard funcional com referência de página
Created August 11, 2020 18:43
Spec de Wizard funcional com enable de página
{
label: 'Formulário step by step de teste',
type: 'custom_form',
fields: [
{
type: 'FormWizard',
name: 'wizform',
label: 'Formulário step by step de teste',
enable: true,
fields: [
"options": [
{"key" : "ent", "label": "Ent"},
{"key": "maiar", "label": "Maiar"},
{"key": "troll", "label" :"Troll"},
{"key":"elfo", "label" : "Elfo"},
{"key":"humano", "label":"Humano"},
{"key":"anao", "label" : "Anão"},
{"key":"hobbit", "label":"Hobbit"},
{"key":"orc", "label":"Orc"},
{"key":"valar", "label":"valar 1"}
{
actor_id: "a7afbf05-75ca-4f46-9319-d34e05be5f3a"
avatar: "https://randomuser.me/api/portraits/men/68.jpg"
checked: false
collection_id: null
created_at: "2020-07-02T19:46:26.341Z"
document_id: null
email: "danilo.pessoa@fdte.io"
email_confirmed: null
id: "a7afbf05-75ca-4f46-9319-d34e05be5f3a"
{
id: 'f5cb052c-6803-4ab2-85cd-858379ecad87',
end: '2020-07-05T17:00:00.358+00:00',
type: null,
start: '2020-07-05T15:00:00.358+00:00',
title: 'eloquentness 413 413',
notify: {},
status: {
checkin: 'DELAYED',
activity: 'SCHEDULED',
{
id: 'f5cb052c-6803-4ab2-85cd-858379ecad87',
end: '2020-07-05T17:00:00.358+00:00',
type: null,
start: '2020-07-05T15:00:00.358+00:00',
title: 'eloquentness 413 413',
notify: {},
status: {
checkin: 'DELAYED',
activity: 'SCHEDULED',