Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

João Faria j-faria

🎯
Focusing
View GitHub Profile
@imneme
imneme / randutils.hpp
Last active Jun 17, 2022
Addresses common issues with C++11 random number generation; makes good seeding easier, and makes using RNGs easy while retaining all the power.
View randutils.hpp
/*
* 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 Sep 24, 2013
Specify which function to run in a module from the command line
View cmd-line-function.py
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])