Skip to content

Instantly share code, notes, and snippets.

View ananace's full-sized avatar

Alexander "Ananace" Olofsson ananace

  • Linköping University
  • Sweden
View GitHub Profile
@ananace
ananace / FindMyGUI.cmake
Created March 27, 2012 14:45
Findmygui changes
# - Find MyGUI includes and library
#
# This module defines
# MYGUI_INCLUDE_DIRS
# MYGUI_LIBRARIES, the libraries to link against to use MYGUI.
# MYGUI_LIB_DIR, the location of the libraries
# MYGUI_FOUND, If false, do not try to use MYGUI
#
# Copyright © 2007, Matt Williams
#
@ananace
ananace / gist:6410128
Created September 2, 2013 07:33
Sublime Update script
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
import urllib2
from subprocess import call
from platform import machine
@ananace
ananace / gist:7023952
Last active December 25, 2015 18:58
XM
Current Server:
IP: 88.206.179.92
Port: 4567
Message:
Header - 5 bytes, network order:
Flags - 1 byte:
SYN - 1
ACK - 2

Examples:

Ruby:

variable = 5

if variable > 4 then
    puts variable.to_s + " is over 4"
    puts "It's exactly five" if variable == 5
elsif variable == 4 then
gets.to_i # I don't care about the number :D
gets # Friendships:
direct_friends = {}
indirect_friends = {}
until /Queries/ =~ (data = gets) do # Until it reads the line Queries:
names = data.split # Split on space
# Create entries in the friend dictionaries if they don't exist
#include <iostream>
using namespace std;
int main(int argc, char* argv[]) {
// Node struct
struct Node {
int data;
Node *next;
};
@ananace
ananace / Script Interface.md
Last active August 29, 2015 14:10
LD31 Script Interface

LD31 Script interface documentation

Global properties

Colors:

Color Colors::Black const

Color Colors::Blue const

@ananace
ananace / gist:de7f30454e99b3952405
Last active July 12, 2023 05:57
OpenMW Windows Development Environment Setup - Appveyor scripts

NB; (An updated version of this guide can be found on the wiki)

OpenMW Windows Dev-Env

What you need?

  • Visual Studio 2013 or 2015 (Community edition is enough)
  • MSYSGit or Git for Windows as it's also called (cinst git.install if you have Chocolatey)
@ananace
ananace / Event.hpp
Created April 26, 2016 23:42
Simple C#-like event handling in C++11
#pragma once
#include <functional>
#include <vector>
template<typename... Args>
class Event
{
public:
typedef std::function<void(Args...)> EventHook;
@ananace
ananace / PackingExample.cpp
Last active May 6, 2018 05:41
Message packing example for libyojimbo, with built-in compression.
#include <yojimbo.h>
#include <miniz.h>
class PackedMessage : public yojimbo::BlockMessage
{
public:
enum { MsgType = 0x00 };
template <typename Stream>
bool Serialize(Stream& stream)