- MongoDB Basics
- SQL vs NoSQL
- What is MongoDB?
- What is MongoDB Atlas?
- When to use MongoDB?
- MongoDB data model and data types
- BSON (Binary JSON) data types
- Double
- String
- BSON (Binary JSON) data types
- Object
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
#!/usr/bin/env ruby | |
# github_dependents.rb | |
# | |
# This script scrapes the "Dependents" list from a GitHub repository's network page, | |
# following pagination and collecting dependent repositories. | |
# It supports: | |
# - Output as table or JSON | |
# - Filtering by minimum stars (--min-stars) | |
# - Rate limit handling (429 with configurable backoff) |
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
# Day 1 | |
sum = 0 | |
File.readlines('day01.txt', chomp: true).each do |line| | |
sum += line.scan(/\d/).values_at(0, -1).join.to_i | |
end | |
puts sum |
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
# Title: LightGallery Tag for Jekyll | |
# Authors: Alex Bevilacqua <[email protected]> | |
# Description: incorporate the LightGallery inline JavaScript gallery | |
# | |
# Adaption of "Photos tag for Jekyll" by Devin Weaver, and the derived | |
# "Gallery Tag for Jekyll" by Kevin Brown. | |
# | |
# Installation: | |
# | |
# {% gallery_includes %} |
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
TODO: | |
☐ [Drivers] Schedule an EMEA/AMER sync @created(21-02-05 06:49) | |
☐ [Drivers] Schedule an Atlas Log Ingestion demo @created(21-02-05 06:49) | |
☐ [sharding] Update TSWRITING-1531 @created(21-01-04 09:58) | |
☐ [Q+I] Research index versions article @created(21-02-05 06:59) | |
☐ [Q+I] https://docs.google.com/document/d/1ba0uGSwcaOilYANjzfNda6wv77yozI3tenGFCUPDM9A/edit @created(21-05-05 12:52) | |
☐ Awaitable ismaster lightning talk @created(21-06-07 16:17) | |
☐ TSWRITING-1912? @created(21-07-05 07:47) | |
☐ Review TSWRITING-1519 @created(21-04-02 09:34) | |
☐ Review Pocket Guide to TimeSeries for Diego @created(21-06-17 09:10) |
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
def replace_target(path, target) | |
p = path.split('/') | |
p[-1] = target | |
return p.join('/').to_s | |
end | |
def cleanup_title(c) | |
title = c.gsub('{','').gsub('}','').gsub("\t", ' ').split(', ')[1..-1].join.strip | |
title = title.delete_prefix('"').delete_suffix('"').delete_suffix(' ,').delete_suffix("\",").delete_suffix("\"").delete_suffix("\" ;") | |
title |
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
function printReplicationTree(rs) { | |
print("\nReplication Sync Source Tree\n============================"); | |
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | |
var idMapping = rs.members.reduce((acc, el, i) => { | |
acc[el.name] = i; | |
return acc; | |
}, {}); |
# Use -f/--filename to pass the file to emit JSON for
ruby dump_bson.rb -f auditLog_prod01.bson
....
{"atype":"authenticate","ts":"2020-11-21 06:25:22 UTC","local":{"ip":"127.0.0.1","port":27013},"remote":{"ip":"127.0.0.1","port":55842},"users":[{"user":"__system","db":"local"}],"roles":[],"param":{"user":"__system","db":"local","mechanism":"SCRAM-SHA-1"},"result":0}
{"atype":"shutdown","ts":"2020-11-21 06:25:23 UTC","local":{"ip":"127.0.0.1","port":27013},"remote":{"ip":"127.0.0.1","port":55842},"users":[{"user":"__system","db":"local"}],"roles":[],"param":{},"result":0}
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
/* | |
* measureInitialSyncProgress | |
* @author Alex Bevilacqua <[email protected]> | |
* @updated 2021-02-23 | |
* | |
* Can be run against a MongoDB 4.2.12+ mongod that is in STARTUP2 (intitial sync) state to gain some | |
* insight into how the sync is progressing based on the improvements introduced with SERVER-47863. | |
* For versions of MongoDB < 4.2.12, see https://www.alexbevi.com/blog/2020/02/13/mongodb-initial-sync-progress-monitoring | |
* | |
* usage: |
NewerOlder