Skip to content

Instantly share code, notes, and snippets.

View ddanielsantos's full-sized avatar

Daniel Santos ddanielsantos

View GitHub Profile
export function removePropriedadesNumeradas<T extends Object>(objetoComNumero: T): Partial<T> {
const objetoTratado: Partial<T> = {}
const propriedades = Object.keys(objetoComNumero) as Array<keyof typeof objetoComNumero>
for (let index = 0; index < propriedades.length; index++) {
if (isNaN(Number(propriedades[index]))) {
objetoComNumero[propriedades[index]] = propriedades[index]
}
}
[
{
"key": "ctrl+n",
"command": "-workbench.action.files.newUntitledFile"
},
{
"key": "ctrl+n",
"command": "explorer.newFile"
},
{
@ddanielsantos
ddanielsantos / preventSWEI-Error.sql
Last active February 14, 2022 17:54
SAP Utilities
-- you must use this syntax to the trick work
-- youre going to select a variable based on the desired field
-- change the line 5 accordingly to your desired table
/* SELECT * FROM OITB x */
DECLARE @ItemGroup AS VARCHAR(MAX)
-- your variable from SAP becomes a SQL server variable
SET @ItemGroup = '%' + /* x.ItmsGrpNam */ [%0] + '%'
@ddanielsantos
ddanielsantos / iconName.ts
Created February 28, 2022 22:40
The way to extract the name of the Icons of a certain Expo Icon component
type IconName = keyof typeof Ionicons.glyphMap
@ddanielsantos
ddanielsantos / fullPageScrollEffect.css
Created March 16, 2022 21:51
Full page scroll effect only with CSS
.parent {
scroll-snap-type: y mandatory;
overflow-y: scroll;
height: 100vh;
}
.child {
height: 100vh;
scroll-snap-align: start;
}
@ddanielsantos
ddanielsantos / roadmap.md
Last active April 6, 2022 14:06
GraphQL Roadmap
  • resolvers
  • queries
  • mutation
  • subscription
  • GraphQL server with helix
  • tests
  • dataloader
  • generate schema
  • consume graphql using Relay
@ddanielsantos
ddanielsantos / structure.md
Created April 6, 2022 14:09
GraphQL Server Structure
  • 1 file per type
  • 1 way of resolver a given type
  • 1 file per subscription
  • organize by feature (User, User)
@ddanielsantos
ddanielsantos / react-functional-component.json
Last active April 13, 2022 13:18
My snippets for VSCode
"fn jsx": {
"prefix": "fntsx",
"body": [
"import React from 'react'",
"",
"export const $1 = () => {",
"\treturn (",
"",
"\t)",
"}"
CREATE extension IF NOT exists pg_cron;
SELECT
cron.schedule(
'webhook-15-minutes', -- name of the cron job
'*/15 * * * *', -- every 15 minute
$$
DELETE FROM public.posts
$$
);
Function GoToFolderName {Set-Location -Path C:/some/folder/idk}
Set-Alias -Name FolderName -Value GoToFolderName