Skip to content

Instantly share code, notes, and snippets.

View Wylan's full-sized avatar
💻

Wylan Wylan

💻
View GitHub Profile
@nsxdavid
nsxdavid / Scale9SPrite.m
Created July 27, 2011 04:35
Scale9Sprite - A Cocos2d 9-Slice Sprite
//
// Scale9Sprite.m
//
// Creates a 9-slice sprite.
#import "Scale9Sprite.h"
@aliang
aliang / mymodel.rb
Created June 13, 2011 06:25
render from model in Rails 3
# yes, sometimes you need to do this. you get pilloried in a forum if you
# ask about it, though!
# this code taken from
# http://wholemeal.co.nz/blog/2011/04/05/rendering-from-a-model-in-rails-3/
class MyModel < ActiveRecord::Base
# Use the my_models/_my_model.txt.erb view to render this object as a string
def to_s
ActionView::Base.new(Rails.configuration.paths.app.views.first).render(