In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and
returning the cached result when the same
inputs occur again.
— wikipedia
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| listen [::]:80; | |
| server_name graphql.mydomain.com.br; | |
| location / { | |
| proxy_pass http://mydomain:8080; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Modify the parts you need to get it working. | |
| */ | |
| var should = require('should'); | |
| var request = require('../node_modules/request'); | |
| var io = require('socket.io-client'); | |
| var serverUrl = 'http://localhost'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { NotificationSentModel } from '@entities'; | |
| import { GraphQLID, GraphQLNonNull } from 'graphql'; | |
| // import { subscriptionWithClientId } from 'graphql-relay-subscription'; | |
| import { withFilter } from 'graphql-subscriptions'; | |
| import { fromGlobalToId, subscriptionObjectType } from './utils'; | |
| import pubSub, { EVENTS } from '../../../pubSub'; | |
| import NotificationSentType from '../NotificationSentType'; | |
| const subscriptionAsyncIterator = () => pubSub.asyncIterator(EVENTS.NOTIFICATION.SENT); |
you should review every pull request of your team
- each pull request will make understand what everyone in your team is working on
- it will ensure you keep consistency of file location, and code patterns
- it will catch bugs/regression early on
- it will teach the best way to solve the problem
you should ensure consistency of the code base
you should pair programming with all devs of your team
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import prettyFormat from 'pretty-format'; | |
| const excludeKeys = ['__fragments', '__id', '__fragmentOwner']; | |
| // strip __fragments, __id, __fragmentOwne | |
| export const relayTransform = (key: string, value: string) => { | |
| if (excludeKeys.includes(key)) { | |
| return undefined; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test, Build and Deploy | |
| on: | |
| pull_request: | |
| types: [closed] | |
| jobs: | |
| build-test-release: | |
| if: github.event.action == 'closed' && github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD Monorepo | |
| env: | |
| AWS_REGION: us-east-1 # N. Virginia | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select id, name from table t1 | |
| where ( | |
| select count(*) from table t2 | |
| where regexp_replace(unaccent(trim(t1.name)), '\W+', '', 'g') ilike regexp_replace(unaccent(trim(t2.name)), '\W+', '', 'g') | |
| ) > 1 | |
| order by name asc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { promises } from "fs"; | |
| import crypto from "crypto"; | |
| import path from "path"; | |
| import { print, parse } from "graphql"; | |
| const plugin = { | |
| name: "relay", | |
| setup: build => { | |
| build.onLoad({ filter: /\.tsx$/, namespace: "" }, async args => { | |
| let contents = await promises.readFile(args.path, "utf8"); |