This file contains hidden or 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
| // | |
| // ImageSwitcher.h | |
| // | |
| // Created by syxc on 02/25/13. | |
| // Copyright (c) 2013 Straw. All rights reserved. | |
| // | |
| @interface ImageSwitcher : UIView <UIScrollViewDelegate> { | |
| CGRect viewSize; | |
| UIScrollView *scrollView; |
This file contains hidden or 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
| // | |
| // UIColor+Hex.h | |
| // | |
| // | |
| // Created by Shen Chao on 11-12-31. | |
| // Copyright (c) 2011年 Test. All rights reserved. | |
| // | |
| #import <UIKit/UIKit.h> |
This file contains hidden or 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
| // via http://stackoverflow.com/a/13068238/1242183 | |
| #define HEIGHT_IPHONE_5 568 | |
| #define IS_IPHONE ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) | |
| #define IS_IPHONE_5 ([[UIScreen mainScreen] bounds ].size.height == HEIGHT_IPHONE_5 ) | |
| // then just check whenever you needs.. | |
| if (IS_IPHONE_5) { | |
| // Code for iPhone5 |
This file contains hidden or 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
| // | |
| // UIImage+Network.h | |
| // Fireside | |
| // | |
| // Created by Soroush Khanlou on 8/25/12. | |
| // | |
| // | |
| #import <UIKit/UIKit.h> |
This file contains hidden or 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
| for (id subview in webView.subviews) { | |
| if ([[subview class] isSubclassOfClass:[UIScrollView class]]) { | |
| for (UIView *scrollSubview in [subview subviews]) { | |
| if ([[scrollSubview class] isSubclassOfClass:[UIImageView class]]) { | |
| scrollSubview.hidden = YES; | |
| } | |
| } | |
| } | |
| } |
This file contains hidden or 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
| /*global jQuery */ | |
| /*! | |
| * FitText.js 1.1 | |
| * | |
| * Copyright 2011, Dave Rupert http://daverupert.com | |
| * Released under the WTFPL license | |
| * http://sam.zoy.org/wtfpl/ | |
| * | |
| * Date: Thu May 05 14:23:00 2011 -0600 | |
| */ |
This file contains hidden or 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
| class Backend(object): | |
| def __init__(self): | |
| engine = create_engine("mysql://{0}:{1}@{2}/{3}".format(options.mysql_user, options.mysql_pass, options.mysql_host, options.mysql_db) | |
| , pool_size = options.mysql_poolsize | |
| , pool_recycle = 3600 | |
| , echo=options.debug | |
| , echo_pool=options.debug) | |
| self._session = sessionmaker(bind=engine) | |
| @classmethod |
This file contains hidden or 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
| #!upstart | |
| description "Sitename-state" | |
| author "Ben Gourley" | |
| start on (local-filesystems and net-device-up IFACE=eth0) | |
| stop on shutdown | |
| respawn # restart when job dies | |
| respawn limit 5 60 # give up restart after 5 respawns in 60 seconds |
This file contains hidden or 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
| $(function () { | |
| "use strict"; | |
| // for better performance - to avoid searching in DOM | |
| var content = $('#content'); | |
| var input = $('#input'); | |
| var status = $('#status'); | |
| // my color assigned by the server | |
| var myColor = false; |
This file contains hidden or 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
| #pragma mark - How to get the size of a UITableView's content view? | |
| #define CGSizesMaxWidth(sz1, sz2) MAX((sz1).width, (sz2).width) | |
| #define CGSizesAddHeights(sz1, sz2) (sz1).height + (sz2).height | |
| + (CGSize)sizeForTableView:(UITableView *)tableView | |
| { | |
| CGSize tableViewSize = CGSizeMake(0, 0); | |
| NSInteger numberOfSections = [tableView numberOfSections]; | |
| for (NSInteger section = 0; section < numberOfSections; section++) { |