Skip to content

Instantly share code, notes, and snippets.

View wtrocki's full-sized avatar
🚀
Making API Backends an Better Place!

Wojciech Trocki wtrocki

🚀
Making API Backends an Better Place!
View GitHub Profile
I would like you to work on reassigning IAM to be new owners of the device folow.
Create comprehensive plan covering:
Reassign CODEOWNERS entries, alerts IAM Workload Identity.
Deliverable: produce PR plan with PR description covering list of updated items with their corresponding links.
Context:

Rate Limit API Examples

This document provides curl examples for the MongoDB Atlas Rate Limit Inspection API endpoints with example response bodies.

Overview

The Rate Limit Inspection API provides visibility into rate limiting bucket states for debugging and monitoring purposes. These endpoints are available for different scopes: organization, group, and user.

Authentication

This file has been truncated, but you can view the full file.
openapi: 3.0.1
info:
description: |-
The MongoDB Atlas Administration API allows developers to manage all components in MongoDB Atlas.
The Atlas Administration API uses HTTP Digest Authentication to authenticate requests. Provide a programmatic API public key and corresponding private key as the username and password when constructing the HTTP request. For example, to [return database access history](#tag/Access-Tracking/operation/listAccessLogsByClusterName) with [cURL](https://en.wikipedia.org/wiki/CURL), run the following command in the terminal:
```
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" \
--digest \
{"name":"redhat_sso","base_url":"https://sso.stage.redhat.com","token_url":"https://sso.stage.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token","jwks":"https://sso.stage.redhat.com/auth/realms/redhat-external/protocol/openid-connect/certs","valid_issuer":"https://sso.stage.redhat.com/auth/realms/redhat-external"}

Think about your data

""" @model """
type YourDataSync {
 _id: MongoObjectID!
 yourData: String
}

Simple case

const SOMETHING_CHANGED_TOPIC = 'something_changed';

export const resolvers = {
  Subscription: {
    somethingChanged: {
      subscribe: () => pubsub.asyncIterator(SOMETHING_CHANGED_TOPIC),
 },
{
"$Version": "4.0",
"Jetsons.Models": {
"company": {
"$Kind": "EntityType",
"$Key": [
"stockSymbol"
],
"stockSymbol": {},
"name": {
echo "Installing required software on root account"
wget https://go.microsoft.com/fwlink/?LinkID=760867
rpm -i code-1.42.1-1581433057.el7.x86_64.rpm
sudo dnf install nodejs
dnf install git
npm install -g yarn
echo "Preconfigure workshop"
mkdir ~/Workshop
cd ~/Workshop
export JAVA_8_HOME='/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/'
export JAVA_8_HOME_GRAAL='/Library/Java/JavaVirtualMachines/graalvm-ce-java8-19.3.0/Contents/Home/'
export JAVA_11_HOME='/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk1/Contents/Home/'
alias java8='export JAVA_HOME=$JAVA_8_HOME'
alias java8graal='export JAVA_HOME=$JAVA_8_HOME_GRAAL'
alias java11='export JAVA_HOME=$JAVA_11_HOME'
# default
java8
@wtrocki
wtrocki / batchLoadData.ts
Last active November 13, 2019 23:28
GraphQL Data Loader Simplified
import DataLoader = require('dataloader');
/**
* Speciallized function that can utilize batching the data basing on
* DataLoader library
*
* @param context - resolver context object that will be used to apply new loader
* @param name - name of the object we want to load
* @param id - id of the object we want to load
*/