Skip to content

Instantly share code, notes, and snippets.

View javorosas's full-sized avatar

Javier Rosas javorosas

View GitHub Profile
@reconbot
reconbot / createComplexityPlugin.ts
Last active September 17, 2024 13:33
An Apollo Plugin for graphql-query-complexity
import { ComplexityEstimator, getComplexity } from 'graphql-query-complexity'
import { GraphQLError, GraphQLSchema, separateOperations } from 'graphql'
import { PluginDefinition } from 'apollo-server-core'
export const createComplexityPlugin = ({
schema,
maximumComplexity,
estimators,
onComplete,
createError = (max, actual) => { throw new GraphQLError(`Query too complex. Value of ${actual} is over the maximum ${max}.`) },
@marufshidiq
marufshidiq / HOWTO.md
Created April 12, 2020 07:03
Backup and Restore mongodb inside docker-compose container

How to backup

docker-compose exec -T <mongodb_service_name> mongodump --archive --gzip --db <mongodb_database> > dump.gz

How to restore

docker-compose exec -T  mongorestore --archive --gzip &lt; dump.gz
@stonehippo
stonehippo / FTDI_Basic_Hookup_for_ESP-01.jpg
Last active January 6, 2022 14:09
Notes on using the ESP8266 with the Arduino IDE
FTDI_Basic_Hookup_for_ESP-01.jpg