Skip to content

Instantly share code, notes, and snippets.

@looopTools
looopTools / Read File to std::vector<uint8_t> in C++
Created February 1, 2019 13:33
How to read a file from disk to std::vector<uint8_t> in C++
inline std::vector<uint8_t> read_vector_from_disk(std::string file_path)
{
std::ifstream instream(file_path, std::ios::in | std::ios::binary);
std::vector<uint8_t> data((std::istreambuf_iterator<char>(instream)), std::istreambuf_iterator<char>());
return data;
}
@kevinmoran
kevinmoran / noacos_derivation.md
Last active January 2, 2024 09:49
How to Calculate a Rotation Matrix to Align Vector A to Vector B in 3D
@dougbinks
dougbinks / ImGuiUtils.h
Created November 18, 2017 13:53
ImGuiUtils.h with TextURL
#pragma once
#include "RuntimeImGui.h"
#include "RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE;
#include "IconsFontAwesome.h" // from https://github.com/juliettef/IconFontCppHeaders
#include "PlatformUtils.h"
namespace ImGui
// ImGui BFFX binding
// In this binding, ImTextureID is used to store an OpenGL 'GLuint' texture identifier. Read the FAQ about ImTextureID in imgui.cpp.
// You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
// If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown().
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
// https://github.com/ocornut/imgui
#include <imgui.h>
#include "imgui_impl_bgfx.h"
@infosec-intern
infosec-intern / vscode.desktop
Last active February 24, 2024 17:29
A simple .desktop file for Visual Studio Code
[Desktop Entry]
Name=Visual Studio Code
Comment=Programming Text Editor
Exec=/usr/local/src/VSCode-linux-x64/code
Icon=/usr/local/src/VSCode-linux-x64/resources/app/resources/linux/code.png
Terminal=false
Type=Application
Categories=Programming;
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com: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