Skip to content

Instantly share code, notes, and snippets.

//
// UIImage+GIF.h
// LBGIFImage
//
// Created by Laurin Brandner on 06.01.12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
@daoseng33
daoseng33 / .clang-format
Last active August 23, 2017 08:49
AlleyStore ObjC clang-format
---
# BasedOnStyle: LLVM
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 4
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
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"
@daoseng33
daoseng33 / gist:9a7316a73443f19fc9ef1b50ce237dfa
Created August 10, 2017 06:38
仿Nice tag 雷達閃爍動畫
#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];
}
<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>
/*
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: