This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- func to be hooked | |
function test(a,b) | |
print('\norg test'); | |
print('a='..a..' b='..b) | |
return a,b; | |
end | |
-- store original func | |
org_test = test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import sys | |
from PySide.QtCore import * | |
from PySide.QtGui import * | |
from PySide.QtWebKit import * | |
class Scrape(QApplication): | |
def __init__(self): | |
print('init') | |
super(Scrape, self).__init__(sys.argv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Impact Plugin | |
* NotificationManager | |
* Written by Abraham Walters | |
* July 2011 | |
* Jxyzzy Dev Company | |
* jxyzzy.com | |
* | |
* This plugin extends the Font class and allows you to pop-up a | |
* text Notification (spawnNote()), move it (this.pos) and have |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::ifstream in("some.file"); | |
std::istreambuf_iterator<char> beg(in), end; | |
std::string str(beg, end); | |
// or | |
std::ifstream in("some.file"); | |
std::ostringstream tmp; | |
tmp << in.rdbuf(); | |
std::string str = tmp.str(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <luabind/luabind.hpp> | |
#pragma comment(lib,"libluabindd.lib") | |
#pragma comment(lib,"lua51.lib") | |
#include <iostream> | |
using namespace std; | |
using namespace luabind; | |
class testlua | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import urllib2 | |
import urllib | |
import cookielib | |
minus_invite = "http://min.us/rjRVW6n" #邀请地址 | |
commit_url = "http://minus.com/api/login/register" #注册地址 | |
def open_url(): | |
"""打开邀请地址""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CString GetModuleDirectory(void) | |
{ | |
TCHAR tempstr[1024]; | |
::GetModuleFileName(AfxGetInstanceHandle(),tempstr,sizeof(tempstr)); | |
CString mulu; | |
mulu.Format(_T("%s"),tempstr); | |
mulu = mulu.Left(mulu.ReverseFind('\\')+1); | |
return mulu; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//使最小化按钮无效 | |
void CMainFrame::OnDisableMinbox() | |
{ | |
//获得窗口风格 | |
LONG style = ::GetWindowLong(m_hWnd,GWL_STYLE); | |
//设置新的风格 | |
style &= ~(WS_MINIMIZEBOX); | |
::SetWindowLong(m_hWnd,GWL_STYLE,style); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
std::string byteToHexStr(unsigned char byte_arr[], int arr_len) | |
{ | |
std::string hexstr; | |
for (int i=0;i<arr_len;i++) | |
{ | |
char hex1; | |
char hex2; | |
int value=byte_arr[i]; //直接将unsigned char赋值给整型的值,系统会自动强制转换 | |
int v1=value/16; |