Skip to content

Instantly share code, notes, and snippets.

View renanmav's full-sized avatar
🏎️
Quando penso que cheguei ao meu limite, descubro que tenho forças para ir além.

Renan Mav renanmav

🏎️
Quando penso que cheguei ao meu limite, descubro que tenho forças para ir além.
View GitHub Profile
@renanmav
renanmav / insomnia-backend-pizza.json
Created June 10, 2019 11:35
Insomnia Workspace for REST API
{"_type":"export","__export_format":4,"__export_date":"2019-06-10T11:34:24.685Z","__export_source":"insomnia.desktop.app:v6.5.4","resources":[{"_id":"req_8e8e37ae31d045bb9600645960f93ac3","authentication":{"token":"{{ token }}","type":"bearer"},"body":{},"created":1559940843522,"description":"","headers":[],"isPrivate":false,"metaSortKey":-1559931917117,"method":"GET","modified":1559968350930,"name":"Index","parameters":[],"parentId":"fld_af239f87e9704576ab1d29c080642c1e","settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingSendCookies":true,"settingStoreCookies":true,"url":"{{ base_url }}/orders","_type":"request"},{"_id":"fld_af239f87e9704576ab1d29c080642c1e","created":1559940843510,"description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1559931905547,"modified":1559940853195,"name":"Orders","parentId":"wrk_e411ae0ef00e4701990cde1b7fb9d964","_type":"request_group"},{"_id":"wrk_e411ae0ef00e4701990cde1b7fb9d964","created":1559854060515,"d
@renanmav
renanmav / insomnia-adonis-tesla-api.json
Created June 13, 2019 15:26
Insomnia Workspace Backup
{"_type":"export","__export_format":4,"__export_date":"2019-06-13T15:25:24.020Z","__export_source":"insomnia.desktop.app:v6.5.4","resources":[{"_id":"req_fc30a991b59e4a4bb2bfcd582e05578d","authentication":{"token":"","type":"bearer"},"body":{},"created":1559848495683,"description":"","headers":[],"isPrivate":false,"metaSortKey":-1559848495683,"method":"GET","modified":1559849552148,"name":"Index","parameters":[],"parentId":"fld_b4f249d232e3428a81ed6f78e4b4daad","settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingSendCookies":true,"settingStoreCookies":true,"url":"{{ base_url }}/projects/2/jobs","_type":"request"},{"_id":"fld_b4f249d232e3428a81ed6f78e4b4daad","created":1559848485159,"description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1559848485159,"modified":1559848485159,"name":"Job","parentId":"wrk_2fd095ae8cb64997b2d9cf16568c5273","_type":"request_group"},{"_id":"wrk_2fd095ae8cb64997b2d9cf16568c5273","created":1559844301050,"descrip
{
"editor.formatOnSave": true,
"editor.tabSize": 2,
"editor.renderLineHighlight": "gutter",
"emmet.syntaxProfiles": {
"javascript": "jsx"
},
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
@renanmav
renanmav / NewTweet.tsx
Created August 14, 2019 23:57
Closure to pass navigation instance to onCompleted function
const NewTweet: NavigationScreenComponent = ({ navigation }) => {
const [content, setContent] = useState("");
const handleCreateTweet = () => {
const input = {
content
};
// TODO: implement optimistic to update the Relay store
const onCompleted = (() => {
import { GraphQLInterfaceType, GraphQLString, GraphQLInt } from 'graphql'
import UserType from '../modules/user/UserType'
const PostType = new GraphQLInterfaceType({
name: 'Post',
description: 'Post interface to enforce some fields',
fields: () => ({
content: { type: GraphQLString },
upvotes: { type: GraphQLInt },
downvotes: { type: GraphQLInt },
@renanmav
renanmav / config.json
Last active September 18, 2019 20:45
My config for VSCode
{
// themes
"workbench.colorTheme": "Dark-Dracula",
"workbench.iconTheme": "material-icon-theme",
"workbench.colorCustomizations": {
"statusBar.background": "#8e1152"
},
// font
"editor.fontSize": 16,
"editor.lineHeight": 24,
@renanmav
renanmav / environment.js
Created September 20, 2019 20:09
Setup RelayNetworkLogger with relay-runtime v6
import { Network } from 'relay-runtime'
import createRelayNetworkLogger from 'relay-runtime/lib/network/createRelayNetworkLogger'
import RelayNetworkLoggerTransaction from 'relay-runtime/lib/network/RelayNetworkLoggerTransaction'
import cacheHandler from './cacheHandler'
const RelayNetworkLogger = createRelayNetworkLogger(RelayNetworkLoggerTransaction)
const network = Network.create(
@renanmav
renanmav / package.json
Last active September 27, 2019 13:55
Dependencies of react-relay v6
{
"private": true,
"dependencies": {
"@types/react": "*",
"@types/relay-runtime": ">=6.0.3",
}
}
@renanmav
renanmav / MyRelayComponent.spec.tsx
Created October 2, 2019 20:54
Simple test of relay component using rtl and relay-test-utils
import rtl from 'react-test-renderer'
import { createMockEnvironment, MockPayloadGenerator } from 'relay-test-utils'
import MyRelayComponent from './MyRelayComponent'
test('Data Render', () => {
const environment = createMockEnvironment()
const renderer = rtl.create(<MyRelayComponent environment={environment} />)
environment.mock.resolveMostRecentOperation(operation => MockPayloadGenerator.generate(operation))
import React from 'react';
import { Image, TouchableWithoutFeedback, View } from 'react-native';
import { t } from 'react-native-tailwindcss';
const s = {
wrapper: [t.bgTransparent, t.w4_12, t.p1, { aspectRatio: 1 }],
field: [t.bgBlue900, t.rounded, t.flex1, t.itemsCenter, t.justifyCenter, t.overflowHidden],
symbol: [t.w8_12, t.objectContain],
success: [t.bgGreen900],
};