Skip to content

Instantly share code, notes, and snippets.

View suhao's full-sized avatar

suhao

View GitHub Profile
@suhao
suhao / VS16NoTelem.bat
Created April 26, 2022 08:48
Disable telemetry in Visual Studio 2019
@echo off
fltmc >nul 2>&1 || (
echo This batch script requires administrator privileges. Right-click on
echo the script and select "Run as administrator".
goto :die
)
rem Change this path if you are using Community or Professional editions
set "VS_INSTALL_DIR=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise"
@suhao
suhao / mraid.js
Created September 4, 2020 07:43 — forked from bensojona/mraid.js
/*
Do not modify this version of the file. It will be copied over when any of the project's targets are built.
If you wish to modify mraid.js, modify the version located at mopub-sdk-common/mraid/mraid.js.
*/
(function() {
var isIOS = (/iphone|ipad|ipod/i).test(window.navigator.userAgent.toLowerCase());
if (isIOS) {
console = {};
console.log = function(log) {
var iframe = document.createElement('iframe');
@suhao
suhao / nvml.cpp
Created December 17, 2019 05:50 — forked from sakamoto-poteko/nvml.cpp
NVML Get GPU Utilization
#include <cstdio>
#include <nvml.h>
#pragma comment(lib, "nvml")
int main(int argc, char* argv[])
{
nvmlReturn_t result;
unsigned int device_count;
@suhao
suhao / boost_signals2_plus_fusion.cc
Created October 2, 2019 13:32 — forked from psfrolov/boost_signals2_plus_fusion.cc
Observable mixins using Boost, the standard library, or a mixture of both.
#include <iostream>
#include <utility>
#include <boost/fusion/container/map.hpp>
#include <boost/fusion/sequence/intrinsic/at_key.hpp>
#include <boost/fusion/sequence/intrinsic/value_at_key.hpp>
#include <boost/optional.hpp>
#include <boost/signals2.hpp>
#include <boost/utility/in_place_factory.hpp>