Skip to content

Instantly share code, notes, and snippets.

@xkyii
xkyii / git乱码解决方案汇总.txt
Created July 13, 2011 05:41
git乱码解决方案汇总
原帖地址: http://topic.csdn.net/u/20110113/19/b0d5d506-4307-428b-a61d-7974aa66a2da.html
首先要说明的是:这里介绍的方法都是大部分是本人“悟”出来的,所以网上难有流传!
好方法不能自己私藏,否则就白忙乎这几天了,分享给有需要的朋友们。如果有转载,敬请注明来自*CSDN老邓*作品。
呵呵,给自己打广告,实在是无耻之极,权当无聊之时打字之用。
欢迎流传,为最优秀的分布式版本管理系统Git做宣传!!
步骤:
1. 下载:http://loaden.googlecode.com/files/gitconfig.7z
2. 解压到:<MsysGit安装目录>/cmd/,例如:D:\Program Files\Git\cmd
@xkyii
xkyii / examsite.json
Last active September 6, 2016 06:29
jkydt.mock
{
"examsites": [
{
"name": "长沙市交警支队科目一考场",
"address": "湖南省长沙市望城区普瑞大道",
"cartype": "A1, A2, A3, B1, B2, C1, C2, C5"
},
{
"name": "长沙支队科目一湘麓分考场",
"address": "湖南省长沙市岳麓区岳麓大道岳麓山大酒店旁",
@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
@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 / 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[])
{
{
"cmd": ["/AutoHotkey/App/AutoHotkey.exe", "/ErrorStdOut", "$file"],
"file_regex": "^[ ]*File \"(...*?)\",\nline ([0-9]*)",
"selector": "source.ahk",
"working_dir": "$file_path"
}
@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,
@xkyii
xkyii / CreateDMG.sh
Last active November 16, 2015 01:25
制作DMG
#!/bin/sh
#from http://blog.csdn.net/zenghao0708/article/details/24330621
LogFile="/private/var/tmp/VTechMakeProductLog.txt";
fun()
{
StateCode=$?
c_time=$(date +%Y/%m/%d" "%H:%M:%S)
/bin/echo "\n$c_time [build dmg] state=[$StateCode]:$1" >> $LogFile
/bin/echo "$2" >> $LogFile 2>&1
}
@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 / 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()