Skip to content

Instantly share code, notes, and snippets.

View ddanielsantos's full-sized avatar

Daniel Santos ddanielsantos

View GitHub Profile
@ddanielsantos
ddanielsantos / list.md
Last active September 14, 2022 17:21
graphql/relay-references
@ddanielsantos
ddanielsantos / bulk-rename.ps1
Created June 28, 2022 21:09
bulk rename powershell
Get-ChildItem *.js | Rename-Item -NewName { $_.Name -replace '.js','.ts' }
Function GoToFolderName {Set-Location -Path C:/some/folder/idk}
Set-Alias -Name FolderName -Value GoToFolderName
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
$$
);
@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)",
"}"
@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 / 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 / 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 / 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 / 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] + '%'