Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
require 'optparse'
require 'logger'
require 'open-uri'
begin
require 'active_resource'
rescue LoadError => e
# active_resource has probably been installed via rubygems
# which, of course, does not put it on the search path
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal

Samples of new usage for [continuations in JBBAdditions][].

The relevant source files are:

  • [JBBTypes.h][]
  • [JBB_C_Functions.h][JBB_C_Functions.h]
  • [JBB_C_Functions.m][JBB_C_Functions.h]
  • [Classes/JBBObjectProxy.h][]
  • [Classes/JBBObjectProxy.h][]
  • [Classes/Extensions/NSInvocation+JBBAdditions.h][]
[color]
diff = auto
status = auto
branch = auto
ui = auto
[log]
date = local
[core]
excludesfile = /Users/dweeks/.gitignore
quotepath = false
#!/usr/bin/python
# Nicolas Seriot
# 2011-01-06
# http://github.com/nst/objc_dep
"""
Input: path of an Objective-C project
Output: import dependancies Graphviz format
#!/usr/bin/env ruby
# get all the file names we are interested in
source_filenames = Dir['**/*.m']
source_filenames.concat( Dir['**/*.xib'] )
png_filenames = Dir['**/*.png']
image_references = Hash.new
png_filenames.each { |filename| image_references[File.basename(filename.downcase)] = 0 }
@pburleson
pburleson / gist:1204983
Created September 8, 2011 22:45
pushViewController:animated:willPopHandler:
@interface UINavigationController (Extensions)
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated willPopHandler:(void (^)(void))inHandler;
@end
#### SNIP HERE ############
#import "UINavigationController+Extensions.h"
@pburleson
pburleson / Ubuntu rbenv
Created November 6, 2011 15:14 — forked from HatemMahmoud/Ubuntu rbenv
Installing Ruby 1.9.2 with OpenSSL on Ubuntu 11.04 using ruby-build and rbenv
# for more info: https://gist.github.com/1120938
#import <UIKit/UIKit.h>
@interface UIButton (UIButton_BackgroundImageAdditions)
-(void) setBackgroundImageWithColor: (UIColor *) color
cornerRadius: (CGFloat) cornerRadius
forState: (UIControlState) state;
@end
@pburleson
pburleson / gist:2784669
Created May 24, 2012 22:44
UIImagePNGRepresentation Crash
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3602632c __pthread_kill + 8
1 libsystem_c.dylib 0x323de29f abort + 94
2 ImageIO 0x37eca8bf png_error + 114
3 ImageIO 0x37ec9fe3 png_write_end + 46
4 ImageIO 0x37ec6069 writeOnePng + 2260
5 ImageIO 0x37ec578b _CGImagePluginWritePNG + 82
6 ImageIO 0x37ec56fd CGImageDestinationFinalize + 132
7 UIKit 0x37342fa7 UIImagePNGRepresentation + 274