Skip to content

Instantly share code, notes, and snippets.

View Tinitto's full-sized avatar

Martin Ahindura Tinitto

View GitHub Profile
@Tinitto
Tinitto / sample_snapshot_test_in_data_science.py
Created January 18, 2020 20:54
Sample code showing how to do snapshot testing in Data Science Pipelines and Systems
import os
import pickle
# ...... more code
# ......
results = some_calculation()
expected_result_file_path = 'path_to_the_snapshot_file_of_choice'
# the snapshot file should not exist at the beginning
@Tinitto
Tinitto / amqp_listener.go
Created May 11, 2021 17:25
How to Connect to an AMQP 1.0 Topic not Queue in Golang
/*
* In an attempt to use the https://github.com/Azure/go-amqp/ to connect to an AMQP topic, I was using the sample code
* on the README but kept getting an error like:
* "Failed creating receiver link *Error{Condition: amqp:unauthorized-access, Description: User qbtzf4r2sqkimdl is not authorized to read from: queue://topic..."
* To connect to an AMQP 1.0 topic, the LinkSourceAddress or the LinkTargetAddres has to be of the form "topic://..."
*/
package main
import (