Skip to content

Instantly share code, notes, and snippets.

@xhan
xhan / SlideShowLayer.h.m
Created November 19, 2009 06:44
SlideShow on Cocos2d-iphone
/*
* SlideShowLayer by Will Larson and Luke Hatcher. 10/29/2008.
* Released under MIT License.
* Please check out from repository for full license detail.
*
* Nothing too exiting happening here.
* Apologies that it is not in Obj2.0
* syntax, but I'm still ambivalent about
* the ambiguousness of properties.
*/
@xhan
xhan / imagecommit_controller.rb
Created October 22, 2009 05:58
redmine image svn system
class ImagecommitController < ApplicationController
before_filter :find_svn_modify
def index
@result = "SVN仓库没有改变!" and return unless @is_modify
end
def commit
unless @is_modify
@xhan
xhan / Base64Encoding Function
Created October 13, 2009 02:58
apps in iphone send email with images
- (NSString *) base64EncodingWithLineLength:(unsigned int) lineLength data:(NSData *)imgData {
static const char *encodingTable = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
const unsigned char *bytes = [imgData bytes];
NSMutableString *result = [NSMutableString stringWithCapacity:[imgData length]];
unsigned long ixtext = 0;
unsigned long lentext = [imgData length];
long ctremaining = 0;
unsigned char inbuf[3], outbuf[4];
short i = 0;
@xhan
xhan / PlayMidiDemoViewController.h.m
Created October 5, 2009 15:17
a demo to show how to enable iPhone play MIDI
//
// PlayMidiDemoViewController.h
// PlayMidiDemo
//
// Created by xhan on 9/9/09.
// Copyright In-Blue 2009. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "fmod.hpp"
class ImagecommitController < ApplicationController
before_filter :find_svn_modify
def index
@result = "SVN仓库没有改变!" and return unless @is_modify
end
def commit
unless @is_modify