Skip to content

Instantly share code, notes, and snippets.

View apathyboy's full-sized avatar

Eric Barr apathyboy

View GitHub Profile
@apathyboy
apathyboy / CMakeLists.txt
Created November 30, 2018 22:23
ctest test explorer issue
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
endif()
project(ctest_issue VERSION 0.1.0)
find_package(Catch2 REQUIRED)
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/utsname.h>
button test
#include <SDL.h>
#include <windows.h>
#include <cstdint>
void Win32_DEBUG_DrawScreenBuffer(void* pixels, int width, int height, int pitch) {
uint8_t* row = reinterpret_cast<uint8_t*>(pixels);
for (int y = 0; y < height; ++y) {
uint32_t* pixel = reinterpret_cast<uint32_t*>(row);
@apathyboy
apathyboy / gist:8dad1b4b00393929c9a63f94c85c5b9e
Created March 30, 2017 11:01
ClangFormat on Save via a C# Visual Commander extension
using EnvDTE;
using EnvDTE80;
public class E : VisualCommanderExt.IExtension
{
public void SetSite(EnvDTE80.DTE2 DTE_, Microsoft.VisualStudio.Shell.Package package)
{
DTE = DTE_;
events = DTE.Events;
documentEvents = events.DocumentEvents;
void ObjectController::_handleSpatialChatInternal(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties)
{
// FIXME: for now assume only players send chat
PlayerObject* playerObject = dynamic_cast<PlayerObject*>(mObject);
BString chatData;
message->getStringUnicode16(chatData);
chatData.convert(BSTRType_ANSI);
#include <iostream>
#include <vector>
#define Y(x) v.push_back(x);
#define REPEAT10(x) REPEAT9(x); x
#define REPEAT9(x) REPEAT8(x); x
#define REPEAT8(x) REPEAT7(x); x
#define REPEAT7(x) REPEAT6(x); x
#define REPEAT6(x) REPEAT5(x); x
#include <functional>
#include <iostream>
#include <vector>
int main() {
// initialize vector to hold 1000 elements
std::vector<std::function<int(int)>> v1;
// fill the vector with 1000 lamdas
for (auto i = 0; i < 1000; ++i)
#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.