Skip to content

Instantly share code, notes, and snippets.

View sherief's full-sized avatar

sherief

View GitHub Profile
@sherief
sherief / Metacommands.txt
Created February 27, 2023 04:23 — forked from K0bin/Metacommands.txt
Nvidia D3D12 Metacommands
ID: 00007FFC8D287130
NAME: Conv (Convolution)
CREATION
NAME: InputResource
Type: GPU DESCRIPTOR HANDLE CBV SRV UAV
Input/Output:
STRUCTOFFSET: 0
NAME: FilterResource
@sherief
sherief / jolt.patch
Created April 13, 2022 00:35
Jolt patch
From ca8c0459fee3e8c87791360eb87c370026a94fb6 Mon Sep 17 00:00:00 2001
From: Sherief Farouk <[email protected]>
Date: Tue, 12 Apr 2022 17:32:48 -0700
Subject: [PATCH] Added explicit PhysicsSystem::Teardown().
---
Jolt/Physics/PhysicsSystem.cpp | 10 ++++++++--
Jolt/Physics/PhysicsSystem.h | 1 +
2 files changed, 9 insertions(+), 2 deletions(-)
@sherief
sherief / gist:616f43f97ce1c267cc0e77fafb1c792c
Created January 11, 2022 09:00 — forked from reidransom/gist:6033227
Configure Zeroconf on FreeBSD

Configure Zeroconf on FreeBSD

Install avahi-app and nss_mdns. Note: avahi-app is chosen over avahi because avahi depends on X11.

$ cd /usr/ports/net/avahi-app
$ sudo make config-recursive
$ sudo make install clean
$ cd /usr/ports/dns/nss_mdns
$ sudo make config-recursive

$ sudo make install clean

@sherief
sherief / gist:b1c47f2a7a015b622c3f15f8f85ac737
Created February 20, 2018 04:45 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@sherief
sherief / custom_iterator.cpp
Created January 18, 2018 13:42 — forked from jeetsukumaran/custom_iterator.cpp
Sample C++/STL custom iterator
// Sample custom iterator.
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558)
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cassert>
Consider a Turing-complete computer with N instructions where N >= 1. Instructions I = { i0, i1, i2, ..., i(n-1)}.
Let's define a Finite State Machine (FSM) that takes as input a binary string of 0s and 1s. The FSM has an integer C that starts as 0.
For every letter consumed by the FSM:
- if the letter is 0, emit the instruction i(C MODULO N) and then reset C to 0
- if the letter is 1, C = C + 1
===== FORMAL END =====
Informal: the number of 1s preceding a 0 is a running tally of its index in the set I, and Modulo is applied to ensure the instruction
class copy_command_list //wraps ID3D12GraphicsCommandList instances of the COPY type variety.
//Why this is needed will be made clear later
{
public:
void CopyBufferRegion(...);
void CopyResource(...);
void CopyTextureRegion(...);
void ResourceBarrier(...);
void Close(); //I'll explain why this returns void and not an HRESULT - it's intentional.
};
@sherief
sherief / gob.h
Created June 7, 2016 10:39 — forked from pervognsen/gob.h
gob.h
#pragma once
#include <stdint.h>
#pragma pack(push, 8)
#if __cplusplus >= 201103L || (__cplusplus && _MSC_VER >= 1900)
#define GOB_DISALLOW_COPYING(type) type(const type&) = delete;
#else
#define GOB_DISALLOW_COPYING(type)
template<class T>
class range
{
public:
class range_iterator
{
public:
range_iterator(const T Position_) : Position(Position_)
{
}
#include <iostream>
#include <cassert>
using namespace std;
typedef unsigned long long uint64;
template<uint64 high, uint64 low>
class cookie
{