Skip to content

Instantly share code, notes, and snippets.

View marshluca's full-sized avatar
🏠
Working from home

Lucas Zhang marshluca

🏠
Working from home
View GitHub Profile
@marshluca
marshluca / BonFire.m
Created March 9, 2010 10:40
iPhone中用图片流制作动画
- (void)viewDidLoad {
[super viewDidLoad];
UIImageView* campFireView = [[UIImageView alloc] initWithFrame:self.view.frame];
campFireView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"campFire01.gif"],
[UIImage imageNamed:@"campFire02.gif"],
[UIImage imageNamed:@"campFire03.gif"],
[UIImage imageNamed:@"campFire04.gif"],
[UIImage imageNamed:@"campFire05.gif"],
@marshluca
marshluca / define_class_dynamiclly.rb
Created February 23, 2010 05:54
动态定义class,连接database, 打印ddl
require 'rubygems'
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter => "mysql",
:host => "localhost",
:database => "myapp",
:username => "root",
:password => "root",
:encoding => "utf8")
# Reincarnation for classes
class Class
def reincarnate
buried = Object.__send__(:remove_const, self.name)
Object.const_set(self.name, Class.new(buried))
end
end
class Abc
@pokeb
pokeb / gist:150447
Created July 20, 2009 17:03
An example showing how to manage a queue with ASIHTTPRequest
//
// MyController.h
//
// Created by Ben Copsey on 20/07/2009.
// Copyright 2009 All-Seeing Interactive. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <GHUnit/GHUnit.h>
@class ASINetworkQueue;