Skip to content

Instantly share code, notes, and snippets.

View j-faria's full-sized avatar
🎯
Focusing

João Faria j-faria

🎯
Focusing
View GitHub Profile
@imneme
imneme / randutils.hpp
Last active March 4, 2024 12:44
Addresses common issues with C++11 random number generation; makes good seeding easier, and makes using RNGs easy while retaining all the power.
/*
* Random-Number Utilities (randutil)
* Addresses common issues with C++11 random number generation.
* Makes good seeding easier, and makes using RNGs easy while retaining
* all the power.
*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Melissa E. O'Neill
*
@adrn
adrn / cmd-line-function.py
Created September 24, 2013 20:40
Specify which function to run in a module from the command line
import sys
def some_name():
print("function 1")
def some_other_name():
print("function 2")
if __name__ == "__main__":
func = getattr(sys.modules[__name__], sys.argv[1])