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 "UITableView+reloadDataAnimated.h" | |
@implementation UITableView (reloadDataAnimated) | |
- (void)reloadDataWithAnimated:(BOOL)animated | |
{ | |
[self reloadData]; | |
if (animated) { | |
CATransition *animation = [CATransition animation]; |
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
// | |
// NSObject+SafeCategory.m | |
// | |
// Created by Tony on 14-4-3. | |
// Copyright (c) 2014年 Tony. All rights reserved. | |
// | |
#import "NSObject+SafeCategory.h" | |
#import <JRSwizzle/JRSwizzle.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
#!/bin/bash | |
mpfl="WNDR3700" | |
mpkg="" | |
# luci | |
mpkg+="luci luci-ssl luci-i18n-chinese" | |
# dnsmasq-full for FreeRouterV2 | |
mpkg+=" -dnsmasq dnsmasq-full" |
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
void bin_to_strhex(unsigned char *bin, uint32_t size) | |
{ | |
char hex_str[]= "0123456789ABCDEF"; | |
unsigned int i; | |
char *result; | |
result = (char *)malloc(size * 2 + 1); | |
(result)[size * 2] = 0; | |
if (!size) |
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
- (BOOL)checkNotificationIsEnabled { | |
UIApplication *application = [UIApplication sharedApplication]; | |
BOOL enabled = NO; | |
// iOS8 and above | |
if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)]) { | |
if ([application isRegisteredForRemoteNotifications]) { | |
UIUserNotificationSettings *settings = [[UIApplication sharedApplication] currentUserNotificationSettings]; | |
if (settings.types != UIUserNotificationTypeNone) { | |
enabled = YES; | |
} |
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
self.backgroundColor = [[UIColor darkGrayColor] colorWithAlphaComponent:0.85]; |
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
#pragma mark - UIAnimation | |
- (void)willMoveToSuperview:(UIView *)newSuperview | |
{ | |
[self enterView]; | |
} | |
#define ANIMATE_DURATION 0.3 | |
- (void)enterView | |
{ |
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
#define UIColorFromHexRGB(rgbValue) [UIColor \ | |
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ | |
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ | |
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] | |
#define UIColorFrom8BitRGB(r, g, b) [UIColor \ | |
colorWithRed:(r)/255.0 \ | |
green:(g)/255.0 \ | |
blue:(b)/255.0 alpha:1.0] |
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
// | |
// GradientView.m | |
// GradientDemo | |
// | |
// Created by Tony Kong on 13-5-26. | |
// Copyright (c) 2013年 Tony Kong. All rights reserved. | |
// | |
#import "GradientView.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
# | |
# Uncrustify Configuration File | |
# File Created With UncrustifyX 0.2 (140) | |
# | |
# Alignment | |
# --------- | |
## Alignment | |