Skip to content

Instantly share code, notes, and snippets.

View adamchel's full-sized avatar

Adam Chelminski adamchel

  • Synthesia
  • Copenhagen, Denmark
View GitHub Profile
@adamchel
adamchel / RNCommunityAsyncStorage.js
Created May 21, 2019 16:57
A Storage class for the MongoDB Stitch React Native SDK
/**
* Copyright 2018-present MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@adamchel
adamchel / main.ts
Last active February 26, 2019 20:27
Small sample application demonstrating custom Codecs with MongoDB Stitch TypeScript SDK
import {
AnonymousCredential,
BSON,
Codec,
Stitch,
RemoteMongoClient,
RemoteMongoCollection
} from 'mongodb-stitch-server-sdk';
// This is the interface we want to insert and retrieve from the collection.
@adamchel
adamchel / bucket_tests.js
Last active November 3, 2017 04:06
MongoDB Field Bucketing Benchmarks
function logMessage(message) {
var d = new Date()
print(`${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}.${d.getMilliseconds()}: ${message}`)
}
coll_size = 50000 // Number of documents in the collection we're aggregating
subdoc_size = 2500 // Number of subfields in the columns subdocument
subdocument_targets = [10, 25, 50, 100, 250, 500, 1000, 1500, 2500]
// Non-bucketed tests
@adamchel
adamchel / atlas_ip_whitelist.py
Last active June 13, 2018 14:50
Script to generate a cURL command that bulk adds IPs to a MongoDB Atlas Group IP whitelist.
#
# Generates a cURL command to add IPs to an MongoDB Atlas Group IP whitelist.
#
import sys
atlas_user = sys.argv[1]
atlas_api_key = sys.argv[2]
atlas_group_id = sys.argv[3]
whitelist_file = sys.argv[4] # Each IP or CIDR block should be separated by a newline

Keybase proof

I hereby claim:

  • I am adamchel on github.
  • I am adamchel (https://keybase.io/adamchel) on keybase.
  • I have a public key whose fingerprint is 161A 0206 E43A DB31 5EF6 D253 8FBE 8B97 8FBF 6FE7

To claim this, I am signing this object: