Skip to content

Instantly share code, notes, and snippets.

View deccer's full-sized avatar
👾

deccer

👾
  • Sol
View GitHub Profile
@deccer
deccer / gist:76d0ac480b67508df423ba9ed257fd21
Last active June 19, 2016 14:44
ECS - Event Dispatcher (WIP)
//
// IEVENT
//
namespace ECS
{
public interface IEvent { }
}
//
// EVENT
using ECS;
using System.Windows.Forms;
namespace WindowsFormsApplication43ECS1
{
public partial class MainForm : Form
{
private Timer _timer;
private EventDispatcher _dispatcher;
- loadkeys de-latin1
- setfont Lat2-Terminus16
- cgdisk /dev/sda
- new -> default -> 32M -> ef02 -> bios -> new -> default -> default -> 8300 -> linux -> write -> yes -> quit
- mkfs.ext4 /dev/sda2
- mount /dev/sda2 /mnt
- export LANG="en_US.UTF-8"
- export LC_COLLATE="C"
- pacman -Syy
- pacstrap /mnt base base-devel git zsh vim
@deccer
deccer / ManagedHook.cs
Last active February 20, 2018 23:00
Global/Local WH_MESSAGE Hook
public enum HookType
{
MessageQueue = 3, //WH_GETMESSAGE
Shell = 10, //WH_SHELL
}
public abstract class ManagedHook : IDisposable
{
private delegate IntPtr MessageDelegate(int code, IntPtr wparam, IntPtr lparam);
@deccer
deccer / gist:2946b55203ca77b212d66c8c0603acc9
Created February 26, 2018 18:45
Project Structure C++
ProjectName\
ProjectName\ProjectName.sln
ProjectName\LibraryA\LibraryA.vcxproj
ProjectName\LibraryA\Source\FileA.cpp
ProjectName\LibraryA\Source\FileB.cpp
ProjectName\LibraryA\Include\LibraryA\FileA.hpp can be included with $(SolutionDir)LibraryA\Include and you can do #include <LibraryA/FileA.hpp>
ProjectName\LibraryA\Include\LibraryA\FileB.hpp
ProjectName\LibraryA\Lib\LibraryA.lib can be included with $(SolutionDir)LibraryA\Lib
public sealed class MessageBus : IMessageBus
{
private interface ISubscriber { }
public class Subscriber<TMessage> : ISubscriber
{
private readonly Func<TMessage, Task> _handler;
internal Subscriber(Func<TMessage, Task> handler)
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
using System.Text;
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
if (requestCode == IntentRequestCodes.OpenFolderForRawImportRequestCode)
{
var folderUri = data.Data;
var documentFolderUri = DocumentsContract.BuildChildDocumentsUriUsingTree(folderUri, DocumentsContract.GetTreeDocumentId(folderUri));
var projection = new[]
namespace Xacor.Graphics
{
public class Shader : IDisposable
{
public class VirtualShaderFile
{
public string Name { get; }
public string Text { get; }
public VirtualShaderFile(string name, string text)
public static void GetVerticesAndIndicesFromModel(Model model, out Vector3[] vertices, out int[] indices)
{
var verticesList = new List<Vector3>();
var indicesList = new List<int>();
var transforms = new Matrix[model.Bones.Count];
model.CopyAbsoluteBoneTransformsTo(transforms);
Matrix transform;
foreach (ModelMesh mesh in model.Meshes)
{