Skip to content

Instantly share code, notes, and snippets.

Philadelphia, PA

Michael Lynn mrlynn

Philadelphia, PA
View GitHub Profile
mrlynn / remote react bootstrap table example
Created Jun 3, 2018 — forked from xabikos/remote react bootstrap table example
An example of a react bootstrap table that fetches the data asynchronously when navigating between pages and when changing the page size
View remote react bootstrap table example
import React, {Component} from 'react';
import {BootstrapTable, TableHeaderColumn} from 'react-bootstrap-table';
import _ from 'lodash';
const dataTable = _.range(1, 60).map(x => ({id: x, name: `Name ${x}`, surname: `Surname ${x}`}));
// Simulates the call to the server to get the data
const fakeDataFetcher = {
fetch(page, size) {
return new Promise((resolve, reject) => {
mrlynn /
Created Jun 13, 2018 — forked from adamchel/
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
mrlynn / mongodb-stitch-kinesis-putrecord.js
Last active Jul 22, 2018
Example MongoDB Stitch Serverless Function to call an Amazon Kinesis to put a record
View mongodb-stitch-kinesis-putrecord.js
exports = function(event){
const awsService ='aws');
Data: JSON.stringify(event.fullDocument),
StreamName: "stitchStream",
PartitionKey: "1"
}).then(function(response) {
return response;
mrlynn / mongodb-stitch-kinesis-putrecord-2.js
Last active Jul 24, 2018
MongoDB Atlas Stitch Example Function Integrating with Amazon Kinesis
View mongodb-stitch-kinesis-putrecord-2.js
exports = function(event){
const db ="mongodb-atlas").db("streamdata");
const clickdata = db.collection("clickdata");
const awsService ='aws');
const geoAPI = "";
const eventFullDocument = event.fullDocument;
const eventDoc = event;
const eventIP = eventFullDocument.ipaddress;
const url = geoAPI + eventIP;
const locationService ="locationService");
mrlynn /
Last active Aug 10, 2018
AWS CLI Whitelist MongoDB Atlas Live Import IP Ranges
# Enter the connection details of your existing MongoDB cluster.
# NOTE: In order for to process the migration request, our servers need to be able to access your source cluster. Make sure to whitelist the following ip address ranges in your firewall.
MYIP=`dig +short`
export SG=MySecurityGroup
mrlynn / send_sms_text_mongodb_stitch.js
Created Sep 20, 2018
Send an SMS Text Message with MongoDB Stitch
View send_sms_text_mongodb_stitch.js
exports = function(message) {
const mongodb ="mongodb-atlas");
const coll = mongodb.db("db").collection("users");
const twilio ="my-twilio-service");
const yourTwilioNumber = context.values.get("twilioNumber");
coll.find().toArray().then(users => {
users.forEach(user => twilio.send({
from: yourTwilioNumber,
body: message
mrlynn / index.html
Created Oct 30, 2018
MongoDB Stitch - Getting Started
View index.html
<!-- Base Stitch Browser SDK -->
<script src=""></script>
<div class="results-bar">
<p>Count of Results:</p>
<span id="num-results" class="results-bar__count"></span>
<table class="table table-striped">
<thead class="thead">
View urlstash-stitch-app
exports = async function (payload) {
const mongodb ="mongodb-atlas");
const exampledb = mongodb.db("exampledb");
const examplecoll = exampledb.collection("examplecoll");
const args = payload.query.text.split(" ");
switch (args[0]) {
case "stash":
const result = await examplecoll.insertOne({
user_id: payload.query.user_id,
View Bubble Sort Example
var countOuter = 0;
var countInner = 0;
var countSwap = 0;
array = [3,9,4,5,1,200,2,88]
var swapped;
do {
mrlynn / removeEventFromMongoDB.js
Created Mar 3, 2019
Google Sheets Script to Remove Events from a MongoDB Database
View removeEventFromMongoDB.js
* Delete the events from the Calendar and remover the eventID Reference from the sheet - wipeout.
function removeEventsFromMongoDB() {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheet = spreadsheet.getSheetByName("Events");
var headerRows = 1; // Number of rows of header info (to skip)
var range = sheet.getDataRange();
var numRows = range.getNumRows();
var data = range.getValues();