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
/* | |
The set S originally contains numbers from 1 to n. But unfortunately, due to the data error, one of the numbers in the set got duplicated to another number in the set, which results in repetition of one number and loss of another number. | |
Given an array nums representing the data status of this set after the error. Your task is to firstly find the number occurs twice and then find the number that is missing. Return them in the form of an array. | |
Example 1: | |
Input: nums = [1,2,2,4] | |
Output: [2,3] | |
Note: |
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
<div style="display: block; padding: 9.5px; margin: 0 0 10px; font-size: 15px; line-height: 1.42857143; color: #333; word-break: break-all; word-wrap: break-word; background-color: #f5f5f5; border: 1px solid #ccc; border-radius: 4px;"> | |
some text here | |
</div> |
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 -- Animation | |
//动画停止执行的delegate | |
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag | |
{ | |
if ([[anim valueForKey:@"TransformScale"] isEqualToString:@"scaleAnimation"]) { | |
//清除上次的shapeLayer 防止内存泄露 | |
for (CAShapeLayer *shapeLayer in shapeLayers) { | |
[shapeLayer removeAnimationForKey:kGroupAnimation]; | |
[shapeLayer removeFromSuperlayer]; | |
} |
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
echo "\Clang-Format all files in current dir except ones in */libs/* folder and names containing *.framework.*" | |
find . -name "*.[hm]" ! -path "*/libs/*" ! -path "*.framework*" ! -path "*/ThirdParty/*" ! -path "*/Pods/*" -print0 | xargs -0 clang-format -i | |
echo "DONE" |
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
--- | |
# BasedOnStyle: LLVM | |
AccessModifierOffset: -2 | |
ConstructorInitializerIndentWidth: 4 | |
AlignEscapedNewlinesLeft: false | |
AlignTrailingComments: true | |
AllowAllParametersOfDeclarationOnNextLine: true | |
AllowShortIfStatementsOnASingleLine: false | |
AllowShortLoopsOnASingleLine: false |
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
// | |
// UIImage+GIF.h | |
// LBGIFImage | |
// | |
// Created by Laurin Brandner on 06.01.12. | |
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | |
// | |
#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
# Stole from: | |
# http://stackoverflow.com/questions/32122784/alias-script-to-delete-all-local-and-remote-git-branches-with-a-specific-prefix | |
git branch -D $(printf "%s\n" $(git branch) | grep 'feature/') | |
# Or this will work too to remove all remote branches: | |
# https://coderwall.com/p/eis0ba/remove-a-thousand-stale-remote-branches-on-git | |
git branch -r | awk -F/ '/\/feature/{print $2}' | xargs -I {} git push origin :{} | |
# Prune all origin branches | |
git remote prune origin |
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
enum Type { | |
case regular | |
case system | |
case advertise | |
} |
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
enum Type { | |
case regular | |
case system | |
case advertise | |
var image: UIImage? { | |
switch self { | |
case .regular: | |
return UIImage(named: "regular") | |
case .system: |
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
enum Type: Int { | |
case regular = 0 | |
case system | |
case advertise | |
var image: UIImage? { | |
switch self { | |
case .regular: | |
return UIImage(named: "regular") | |
case .system: |
OlderNewer