Skip to content

Instantly share code, notes, and snippets.

@zakdances
zakdances / gist:5158875
Created March 14, 2013 04:46
Pass a selector of elements you want to scrub clean of PyJade bugs.
fixPyJadeBugs = (sels) ->
sels.each () ->
element = $(this)
fix = (attrib) ->
value = attrib.value.replace /_/g, ' '
if value[0] == '"' and ( value[value.length-1] == '"' or ( value[value.length-2] == '"' and value[value.length-1] == '/' ) )
max = if value[value.length-1] == '/' then value.length-2 else value.length-1
element.attr attrib.name, value.substring('1',max)
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];