Skip to content

Instantly share code, notes, and snippets.

View zhenghao1's full-sized avatar

Mark Huang zhenghao1

View GitHub Profile
@zhenghao1
zhenghao1 / DetectorDlg.cpp
Created February 27, 2014 19:10
Detecting a USB mounted hard drive
// DetectorDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Detector.h"
#include "DetectorDlg.h"
#include "windows.h"
#include "WinDef.h"
#include "ntddstor.h"
#include "winioctl.h"
@zhenghao1
zhenghao1 / BoxDlg.cpp
Created February 27, 2014 19:15
MFC Multi-line CComboBox
// BoxDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Box.h"
#include "BoxDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
@zhenghao1
zhenghao1 / correct.cpp
Created February 28, 2014 14:55
User defined functions cannot return local variables
void getID(DWORD mask, TCHAR* item)
{
_stprintf(item, "Hello World!");
}
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
'use strict';
(function() {
var mod = angular.module("App.services", []);
//register other services here...
/* pubsub - based on https://github.com/phiggins42/bloody-jquery-plugins/blob/master/pubsub.js*/
mod.factory('pubsub', function() {
var cache = {};