Skip to content

Instantly share code, notes, and snippets.

@xkyii
xkyii / NotificationManager.js
Created February 6, 2012 07:34 — forked from quidmonkey/NotificationManager.js
NotificationManager for ImpactJS
/*
* 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
@xkyii
xkyii / auto_google_search.py
Created February 22, 2012 06:49
My Python Script
# -*- 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)
@xkyii
xkyii / hook_func.lua
Created February 28, 2012 15:25
My Lua Script
-- 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;
@xkyii
xkyii / astar.py
Created May 25, 2012 11:13 — forked from jdp/LICENSE
A* pathfinding over any arbitrary graph structure, with example Cartesian grid implementation
class AStar(object):
def __init__(self, graph):
self.graph = graph
def heuristic(self, node, start, end):
raise NotImplementedError
def search(self, start, end):
openset = set()
closedset = set()
@xkyii
xkyii / CSingleton.h
Created May 30, 2012 08:59
Singleton
#if !defined(UTILHY_SINGLETON_INCLUDED_)
#define UTILHY_SINGLETON_INCLUDED_
//////////////////////////////////////////
// 使用:
// 1, 继承 public CSingleton<T>
// 2, 增加成员量: friend class CSingleton<T>;
//////////////////////////////////////////
template <class T>
class CSingleton {
@xkyii
xkyii / minizip.cpp
Created January 27, 2013 15:06
Minizip压缩加密示例代码
void crypt_test()
{
zipFile zf = zipOpen("myarch.zip",APPEND_STATUS_ADDINZIP);
int ret = zipOpenNewFileInZip(zf,
"myfile.txt",
&zfi,
NULL, 0,
NULL, 0,
"my comment for this interior file",
Z_DEFLATED,
{
"cmd": ["/AutoHotkey/App/AutoHotkey.exe", "/ErrorStdOut", "$file"],
"file_regex": "^[ ]*File \"(...*?)\",\nline ([0-9]*)",
"selector": "source.ahk",
"working_dir": "$file_path"
}
@xkyii
xkyii / embedPython.cpp
Last active December 16, 2015 20:59
Python + C++相关
// get_pyfiles.cpp : 定义控制台应用程序的入口点。
//
#include <Python.h>
#include <Windows.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
@xkyii
xkyii / mulitiColor.cpp
Last active December 17, 2015 10:49
cocos2dx相关片段
// 使用CCLabelBMFont创建文字
// arial16.fnt可以在cocos2d-x包里找到
CCLabelBMFont* label = CCLabelBMFont::labelWithString("Hello World", "arial16.fnt");
label->setPosition(ccp(320, 480));
label->setScale(5);
addChild(label);
// 为每个单独的字设定颜色
for (int i=0; i<label->getChildrenCount(); i++)
{
CCSprite* sub = (CCSprite*)label->getChildByTag(i);
@xkyii
xkyii / display_modify.lua
Created November 11, 2013 07:48
修改quick-x的部分函数
function display.newFrames(pattern, begin, length, isReversed)
local frames = {}
local step = 1
local last = begin + length - 1
if isReversed then
last, begin = begin, last
step = -1
end