Skip to content

Instantly share code, notes, and snippets.

View mcleary's full-sized avatar

Thales Sabino mcleary

View GitHub Profile
@mcleary
mcleary / Set-NotificationIconsVisible.ps1
Created March 22, 2024 09:27 — forked from psitem/Set-NotificationIconsVisible.ps1
Sets all Windows Taskbar Notification Icons to Visible. Should probably be in a Scheduled Task set to run 'At log on' and 'Repeat task every: 1 hour'
$basePath = 'HKCU:\Control Panel\NotifyIconSettings\'
Get-ChildItem -Path $basePath | `
ForEach-Object { Get-ItemProperty "$basePath$($_.PSChildName)" } | `
Set-ItemProperty -Name 'IsPromoted' -Value 1
@mcleary
mcleary / LoadTexturesParallel.cpp
Created July 6, 2023 10:54
Function to load textures from disk using stb to OpenGL in Parallel. Not worth using if loading a small number of small textures
std::map<std::string, GLint> LoadTextures(const std::vector<std::string>& InTextureFiles)
{
struct TextureData
{
std::int32_t TextureWidth = 0;
std::int32_t TextureHeight = 0;
std::uint8_t* Data = nullptr;
};
std::mutex PrintMutex;
@mcleary
mcleary / Gooch.glsl
Created December 14, 2020 23:21
Gooch Shading
precision highp float;
uniform float time;
uniform vec2 resolution;
varying vec3 fPosition;
varying vec3 fNormal;
varying vec3 fLight;
void main()
@mcleary
mcleary / CLExample.cpp
Created May 14, 2020 09:42
Simple OpenCL example
#include <iostream>
#include <ctime>
#ifdef __APPLE__
#include <OpenCL/cl.hpp>
#else
#include <CL/cl.hpp>
#endif
#define NUM_GLOBAL_WITEMS 1024
@mcleary
mcleary / OpenCLApp.cpp
Created April 23, 2019 14:13
Very simple OpenCL application.
#include <iostream>
#include <vector>
#define CL_HPP_TARGET_OPENCL_VERSION 200
#define CL_HPP_ENABLE_EXCEPTIONS
#include <CL/cl2.hpp>
using namespace std;
int main() {
@mcleary
mcleary / assert_frames_equal.ipynb
Created May 16, 2018 10:31 — forked from jiffyclub/assert_frames_equal.ipynb
Example of a function to compare two DataFrames independent of row/column ordering and with handling of null values.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mcleary
mcleary / cpp_multiple_inheritance_constructor_order.cpp
Created August 31, 2017 15:12
Shows that the order in which constructor of classes with multiple inheritance is defined by the declaration in the header file.
#include <iostream>
using namespace std;
class BaseClass1
{
public:
BaseClass1()
{
cout << "Base class 1 constructor" << endl;
@mcleary
mcleary / template_specialization.cpp
Created August 30, 2017 09:28
Full template specialization
#include <iostream>
class Statement
{
public:
template<typename T>
T Get(int index);
@mcleary
mcleary / CMakeLists.txt
Created August 29, 2017 21:42
How to print the compiler definitions in a CMake project
get_directory_property( DirDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS )
foreach( d ${DirDefs} )
message( STATUS "Found Define: " ${d} )
endforeach()
#message( STATUS "DirDefs: " ${DirDefs} )
@mcleary
mcleary / chrono_function_timing.cpp
Created October 14, 2016 14:37
Timing a function with <chrono>
#include <iostream>
#include <thread>
#include <chrono>
void really_long_function()
{
using namespace std::chrono;
// Very cool user defined literals for duration representation
std::this_thread::sleep_for(3000ms);