Skip to content

Instantly share code, notes, and snippets.

View pillar's full-sized avatar

pillar pillar

  • home
  • Guangzhou, China
View GitHub Profile
/*
zyllibjs_xml
XML处理
@author zyl910
在编写处理xml的网页时,经常为浏览器兼容性头疼。于是我将常用的xml操作封装为函数。经过一段时间的改进,现在已经很稳定了,用起来很舒服。
函数有——
xml_loadFile:xml同步/异步加载。
xml_transformNode:xsl转换。
@pillar
pillar / boost.sh
Created February 13, 2014 03:11 — forked from pa-zz-yco/boost.sh
#===============================================================================
# Filename: boost.sh
# Author: Pete Goodliffe
# Copyright: (c) Copyright 2009 Pete Goodliffe
# Licence: Please feel free to use this, with attribution
# Modified version
#===============================================================================
#
# Builds a Boost framework for the iPhone.
# Creates a set of universal libraries that can be used on an iPhone and in the
@pillar
pillar / RadialLayout.cs
Last active September 19, 2015 18:44 — forked from DGoodayle/RadialLayout.cs
Radial Layouts in Unity
using UnityEngine;
using UnityEngine.UI;
/*
Radial Layout Group by Just a Pixel (Danny Goodayle) - http://www.justapixel.co.uk
Copyright (c) 2015
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
using UnityEngine.EventSystems;
namespace UnityEngine.UI
{
[RequireComponent (typeof (Canvas))]
[ExecuteInEditMode]
[AddComponentMenu("Layout/Reference Resolution", 101)]
public class ReferenceResolution : UIBehaviour
{
// copy from http://blog.csdn.net/peng_weida/article/details/7843504
#include <stdio.h> //perror()
#include <stdlib.h>
#include <netdb.h> //getprotobynumber gethostbyname
#include <unistd.h> //setuid() getuid() sleep() alarm()
#include <sys/types.h> //getuid()
#include <string.h> //bzero(s, n) 将s的前n个字节设为0
#include <signal.h> //signal()
#include <time.h> //gettimeofday()
using UnityEngine;
using UnityEditor;
using System.Collections;
class ProcessModel : AssetPostprocessor
{
void OnPostprocessModel( GameObject input )
{
// 只处理名为"Enemy2b"的模型
if (!input.name.Contains("Enemy2b"))
@pillar
pillar / QuadTreeTest.cs
Created May 19, 2016 03:39 — forked from DGoodayle/QuadTreeTest.cs
Quadtree in Unity
using UnityEngine;
using System.Collections;
public class QuadTreeTest : MonoBehaviour {
public class TestObject : IQuadTreeObject{
private Vector3 m_vPosition;
public TestObject(Vector3 position){
m_vPosition = position;
}
public Vector2 GetPosition(){
@pillar
pillar / ExecutionOrderManager.cs
Created May 19, 2016 03:48 — forked from Skybladev2/ExecutionOrderManager.cs
Explicit script exection order for Unity scripts
using System;
using UnityEditor;
[InitializeOnLoad]
public class ExecutionOrderManager : Editor
{
static ExecutionOrderManager()
{
foreach (MonoScript monoScript in MonoImporter.GetAllRuntimeMonoScripts())
{
@pillar
pillar / ccCompressPvrToCCZFile
Last active May 19, 2016 09:20
saveImageToPVRCCZ
bool ZipUtils::ccCompressPvrToCCZFile(unsigned char *inBuffer,unsigned long inLength, const char *pszFileName)// inBuffer是pvr数据,inLength是pvr数据的长度
{
bool bRet = false;
do
{
if (NULL == pszFileName) {
CCLOG("cocos2d: Error pszFileName NULL!");
}
if(NULL == inBuffer || 0 == inLength)
#!/bin/sh
convert_img(){
for file in `ls -a $1`
do
if [ x"$file" != x"." -a x"$file" != x".." ];then
str="$1/$file"
length=${#str}
sufLength=$(($length - 4))
strSuf=${str:$sufLength:$length}