Skip to content

Instantly share code, notes, and snippets.

@LordJZ
LordJZ / gist:1460491
Created December 11, 2011 13:02
SMSG_UPDATE_OBJECT movement part as of 4.3
WowGuid guid;
this.HaveAttackingTarget = Reader.UnalignedReadBit();
guid.Bytes[2] = Reader.UnalignedReadTinyInt(1);
this.HaveVehicleData = Reader.UnalignedReadBit();
guid.Bytes[1] = Reader.UnalignedReadTinyInt(1);
guid.Bytes[4] = Reader.UnalignedReadTinyInt(1);
guid.Bytes[3] = Reader.UnalignedReadTinyInt(1);
this.HaveTransportExtra = Reader.UnalignedReadBit();
this.HaveGameObjectPosition = Reader.UnalignedReadBit();
bool field_1C8 = Reader.UnalignedReadBit();
@LordJZ
LordJZ / gist:1572224
Created January 6, 2012 20:18
Windows Presentation Framework thread-safeness providers
using System;
using System.Windows.Threading;
namespace Kamilla.WPF
{
/// <summary>
/// Contains extension methods to the classes of the Windows Presentation Framework (WPF).
/// </summary>
public static class WpfExtensions
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Kamilla.Network.Protocols.Wow.Game;
namespace Kamilla.Network.Protocols.Wow
{
public sealed class WowGuidSortedDictionary<T> : IDictionary<WowGuid, T>
{
diff --git a/src/framework/Utilities/UnorderedMapSet.h b/src/framework/Utilities/UnorderedMapSet.h
index a50d7ec..d7adae2 100644
--- a/src/framework/Utilities/UnorderedMapSet.h
+++ b/src/framework/Utilities/UnorderedMapSet.h
@@ -31,6 +31,9 @@
#elif COMPILER == COMPILER_GNU && __GNUC__ >= 3
# include <ext/hash_map>
# include <ext/hash_set>
+#elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1700 // VC11.0 and later
+# include <unordered_map>
@LordJZ
LordJZ / gist:2626246
Created May 7, 2012 06:26
mangos-style update field storage to rtrimmed LE binary storage converter
DELIMITER $$
DROP FUNCTION IF EXISTS int2le$$
CREATE FUNCTION int2le(src INT)
RETURNS BINARY(4)
BEGIN
RETURN REVERSE(UNHEX(LPAD(HEX(src), 8, '0')));
END$$
DROP FUNCTION IF EXISTS convertField$$
@LordJZ
LordJZ / gist:2899215
Created June 9, 2012 03:09
LINQ goodness
void UpdateCheckedCategories()
{
this.ThreadSafeBegin(_ =>
{
var checkedInfos = _.m_categories
.Where(info => info.CheckBox.Visibility == Visibility.Visible)
.Where(info => info.CheckBox.IsChecked == true);
_.CategoriesExpanderHeader.Text = string.Join(", ", checkedInfos
.Select(info => info.Privilege.ToString())
@LordJZ
LordJZ / gist:3060011
Created July 6, 2012 12:53
Emote Fixer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBFilesClient.NET;
using System.IO;
namespace EmoteFixGen
{
public class EmoteEntry
@LordJZ
LordJZ / gist:3892726
Created October 15, 2012 14:25
INotifyPropertyChanged Property Snippet
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>INotifyPropertyChanged Property</Title>
<Shortcut>propn</Shortcut>
</Header>
<Snippet>
<Code Language="CSharp">
<![CDATA[#region $PropertyName$ property
using System;
using System.ComponentModel;
using System.Diagnostics.Contracts;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using LordJZ.WinAPI;
@LordJZ
LordJZ / services.hxx
Last active December 10, 2015 14:58
C++ Service Locator
#pragma once
#ifndef _a553_services_services_h
#define _a553_services_services_h
#include <a553/internals.h>
#include <a553/compiler.h>
#pragma region private details