Skip to content

Instantly share code, notes, and snippets.

View Neferetheka's full-sized avatar

Galaad Linosfil Neferetheka

View GitHub Profile
@Neferetheka
Neferetheka / gist:3424009
Created August 22, 2012 09:27
Display last C++ error in Visual Studio output console
DWORD dw = GetLastError();
char *TextSize;
std::printf("Error has occured: ");
FormatMessage(0x00000100 | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0,
dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &TextSize, 0, 0);
OutputDebugString((LPCWSTR)TextSize);
@Neferetheka
Neferetheka / Swype gestures winJS
Created August 10, 2012 08:27
Swype gestures for Windows 8
/*
*Add an event handler to an element to detect pointer down
*Ensure that is a touch event
*MSPointerDown and MSPointerUp are Windows 8/IE10 events. You should look at another code to handle gestures on other browsers
*/
this._element.addEventListener("MSPointerDown", function (e) {
//Touch event
if (e.pointerType == 2) {
context._gestureInfos = new Object();
context._gestureInfos.started = true;