Skip to content

Instantly share code, notes, and snippets.

View xingfuqiu's full-sized avatar
👋
不写代码了!

David Qiu xingfuqiu

👋
不写代码了!
View GitHub Profile
@xingfuqiu
xingfuqiu / Logger.pas
Created October 11, 2013 01:56
Delphi 日志类
unit Logger;
//=======================================================================
// 日志类(TLoger) ver.1.0
// PFeng (http://www.pfeng.org / xxmc01#gmail.com)
// 2012/11/08
// 日志级别约定:
// 0 - Information
// 1 - Notice
// 2 - Warning
// 3 - Error
@xingfuqiu
xingfuqiu / SX_Lesson2.cpp
Created August 7, 2013 09:37
C++:孙鑫教程Lesson2
#include <iostream>
using namespace std;
class Point
{
public:
int x;
int y;
/**
@xingfuqiu
xingfuqiu / GetFiles.cpp
Created August 7, 2013 07:18
遍历文件夹
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
BOOL IsRoot(LPCTSTR lpszPath)
{
TCHAR szRoot[4];
wsprintf(szRoot, "%c:\\", lpszPath[0]);
return (lstrcmp(szRoot, lpszPath) == 0);
}
@xingfuqiu
xingfuqiu / sublime_hotkey
Created August 7, 2013 07:16
Sublime Text常用快捷键
Ctrl+Shift+P:打开命令面板
Ctrl+P:搜索项目中的文件
Ctrl+G:跳转到第几行
Ctrl+W:关闭当前打开文件
Ctrl+Shift+W:关闭所有打开文件
Ctrl+Shift+V:粘贴并格式化
Ctrl+D:选择单词,重复可增加选择下一个相同的单词
Ctrl+L:选择行,重复可依次增加选择下一行
Ctrl+Shift+L:选择多行
Ctrl+Shift+Enter:在当前行前插入新行
@xingfuqiu
xingfuqiu / .gitignore
Created June 26, 2013 09:24
gitignore in delphi
*.dcu
*.~*~
*.local
*.identcache
__history
*.drc
*.map
*.exe
*.dll
bin/*
@xingfuqiu
xingfuqiu / gist:3368123
Created August 16, 2012 07:38
Delphi:在已有的表中添加字段
//MMWIN:MEMBERSCOPY
unit _MM_Copy_Buffer_;
interface
type
TCodeTemplate = class(TDataModule)
private
//---------------------------------增加字段-------------------------------------
function AppendField(Fields: TStringList; TableName, FieldName, FieldType, FieldSize: String): Boolean;
@xingfuqiu
xingfuqiu / uThreadPool.pas
Created August 15, 2012 03:27
Delphi:线程池
unit uThreadPool;
{ aPool.AddRequest(TMyRequest.Create(RequestParam1, RequestParam2, ...)); }
interface
uses
Windows,
Classes;
// 是否记录日志
@xingfuqiu
xingfuqiu / IsWin64.pas
Created August 15, 2012 02:59 — forked from melice/IsWin64.pas
Delphi:检查Windows系统是否为64bit(check if is windows 64bit)
function IsWin64: Boolean;
var
Kernel32Handle : THandle;
IsWow64Process : function(Handle: Windows.THandle; var Res: Windows.BOOL): Windows.BOOL; stdcall;
GetNativeSystemInfo : procedure(var lpSystemInfo: TSystemInfo); stdcall;
isWoW64 : Bool;
SystemInfo : TSystemInfo;
const
PROCESSOR_ARCHITECTURE_AMD64 = 9;
PROCESSOR_ARCHITECTURE_IA64 = 6;
@xingfuqiu
xingfuqiu / vistamute.h
Created August 15, 2012 02:18
C++:win7单进程静音h
// VistaVolume.h
#ifndef _VISTAVOLUME_H_
#define _VISTAVOLUME_H_
#include <Windows.h>
#include <Mmdeviceapi.h> // for IMMDeviceEnumerator and IMMDevice
#include <Endpointvolume.h> // for IAudioEndpointVolume, must #define NTDDI_VERSION NTDDI_WINXPSP1 in stdafx.h
#include <Audiopolicy.h>
#include <Audioclient.h>
@xingfuqiu
xingfuqiu / vistamute.cpp
Created August 15, 2012 02:18
C++:Win7单进程静音CPP
#include "VistaMute.h"
template <class T>
inline void SafeRelease(T &p)
{
if (p != NULL)
{
p->Release();
p = NULL;
}