This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;{ | |
CGFloat heightForRowAtIndexPath = 44.f; | |
NSString * cellID = [self cellIdForIndexPath:indexPath]; | |
UITableViewCell <XXApplicationTableViewCellConfiguring> * cell = [tableView dequeueReusableCellWithIdentifier:cellID]; | |
if([cell conformsToProtocol:@protocol(XXApplicationTableViewCellConfiguring)]) { | |
[cell configureCellWithApplicationModel:self.application]; | |
[cell layoutSubviews]; | |
heightForRowAtIndexPath = [cell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# psg NAME | |
function psg { | |
processes=$(pgrep $@) | |
if [ -z "$processes" ]; then | |
echo "No matches" | |
else | |
ps $processes | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(IBAction)show:(id)sender{ | |
CGRect frame = [aView frame]; | |
frame.origin.y = [[self view] bounds].size.height; | |
[aView setFrame:frame]; | |
[[self view] addSubview:aView]; | |
[UIView beginAnimations:@"slide up" context:NULL]; | |
frame.origin.y = [[self view] bounds].size.height - frame.size.height; | |
[aView setFrame:frame]; | |
[UIView commitAnimations]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Original | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
static NSString *firstLaunchKey = @"firstLaunch"; | |
// Register default defaults | |
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; | |
NSDictionary *defaultDefaults = [[NSDictionary alloc] initWithObjectsAndKeys: | |
[NSNumber numberWithBool:YES], firstLaunchKey, | |
nil]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// IZGoogleGeocoder.m | |
// JSON Google Geocoder | |
// | |
// Created by Zsombor Szabó on 2/11/11. | |
// Copyright 2011 IZE. All rights reserved. | |
// | |
#import "IZGoogleGeocoder.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation BHSCollectionViewFlowLayout | |
- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect { | |
NSArray *allAttrs = [super layoutAttributesForElementsInRect:rect]; | |
for (UICollectionViewLayoutAttributes *attributes in allAttrs) { | |
attributes.frame = CGRectIntegral(attributes.frame); | |
} | |
return allAttrs; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Common.h | |
// Userful Macro | |
// | |
// Created by Reefaq on 06/12/12. | |
// Copyright (c) 2012 Reefaq. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <UIKit/UIKit.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE GADTs, DataKinds, KindSignatures, StandaloneDeriving #-} | |
module BezierVec (bezier) where | |
infixr ::: | |
-- encoding of natural numbers (zero and successor of a natural) | |
data Nat = Z | S Nat | |
-- indexed vectors are lists whose first type argument encodes the length of the list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Export iOS App Icons | |
// by Lucius Kwok | |
// Takes the currently open document and exports it in the standard iOS app icon sizes. | |
// This script is designed for Photoshop CS5. | |
// To install, place this file in the /Applications/Adobe Photoshop CS5/Presets/Scripts/ folder. | |
try { | |
var doc = app.activeDocument; | |
var startState = doc.activeHistoryState; | |
var initialPrefs = app.preferences.rulerUnits; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
UIColor * operator"" _c(unsigned long long color) | |
{ | |
unsigned long long redComponent = (color & 0xff0000 >> 16); | |
unsigned long long greenComponent = (color & 0x00ff00) >> 8; | |
unsigned long long blueComponent = color & 0xff; | |
float red = redComponent / 255.0; | |
float green = greenComponent / 255.0; | |
float blue = blueComponent / 255.0; |
OlderNewer