Skip to content

Instantly share code, notes, and snippets.

René van Mil rvanmil

Block or report user

Report or block rvanmil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rvanmil
rvanmil / oplog.js
Last active May 22, 2019
parse mongodb oplog
View oplog.js
const fs = require('fs')
fs.readFile('./oplog.dump', 'utf-8', (err, jsonString) => {
const oplog = JSON.parse(jsonString)
const operationsMap = new Map()
oplog.forEach((oplogItem) => {
const { ns, op } = oplogItem
let operation = operationsMap.get(ns)
if (operation) {
if (op === 'd') {
@rvanmil
rvanmil / async.js
Created Nov 29, 2018
Parallel and sequential async processing
View async.js
const randomTimeout = () => Math.floor(Math.random() * (3000 - 500)) + 500
const someAsyncProcess = message => new Promise(resolve => setTimeout(() => {
console.log(message)
resolve()
}, randomTimeout()))
const messages = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
const testParallel = async () => Promise.all(messages.map(async message => someAsyncProcess(message)))
@rvanmil
rvanmil / zcl_bitwise.abap
Last active Feb 11, 2019
ABAP bit shifting and bitwise add, subtract, multiply
View zcl_bitwise.abap
class ZCL_BITWISE definition
public
final
create public .
public section.
*"* public components of class ZCL_BITWISE
*"* do not include other source files here!!!
class-methods CLASS_CONSTRUCTOR .
You can’t perform that action at this time.