Skip to content

Instantly share code, notes, and snippets.

View oneup's full-sized avatar

Florian Hufsky oneup

View GitHub Profile
@oneup
oneup / quartz iphone draw circle
Created July 8, 2009 17:04
teaches how to draw a circle using iphone sdk quartz stuff
- (void)makeCircleAt:(CGPoint)center withDiameter:(float)diameter withColor:(int)myColor
{
float radius = diameter * 0.5;
CGRect myOval = {center.x - radius, center.y - radius, diameter, diameter};
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetRGBFillColor(context, 1.0, 0.0, 0.0, 1.0);
CGContextAddEllipseInRect(context, myOval);
CGContextFillPath(context);
}
@oneup
oneup / conventions
Created July 6, 2009 01:12
eat l337 suckahs
repl: [up] is the last used line (cycles upwards)
text: #foo is a tag; @foo likewise, but informs user (object with that name)
repl alias shell
def safe_eval(text)
begin
Kernel.eval(text)
rescue Exception => e
"Exception " + e.to_s
rescue SyntaxError => e
"Syntax Error #{e}"
rescue Error => e
"Error #{e}"
rescue NameError => e #"multicast" nameerror, so inventory can caputre it
@oneup
oneup / gist:74071
Created March 4, 2009 23:01
thoughts
online code repository for ruby/game code.
game client fetch from library & cache
ruby, gosu, opengl, bastardshell (OS/3)
evil idea:
use gist as code editor with highlighting (for JSmalltalk)
requires cross_domain_xhr_transport ]] cross_domain_ajax
# that would be so cooL!