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
import UIKit | |
import Photos | |
private func imageWithImage(originImage:UIImage, targetSize:CGSize, contentMode: PHImageContentMode) -> UIImage { | |
let originSize = CGSize(width: originImage.size.width * originImage.scale, | |
height: originImage.size.height * originImage.scale) | |
let originRatio = originImage.size.width / originImage.size.height | |
let targetSizeRatio = targetSize.width / targetSize.height | |
var newSize: CGSize; |
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
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; | |
[formatter setFormatterBehavior:NSNumberFormatterBehavior10_4]; | |
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle]; | |
[formatter setLocale:[NSLocale currentLocale]]; | |
NSLog(formatter.currencyCode); | |
NSLog([formatter stringFromNumber:@100]); | |
formatter = [[NSNumberFormatter alloc] init]; | |
[formatter setFormatterBehavior:NSNumberFormatterBehavior10_4]; |
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
git clone git://xxx | |
git remote add upstream git://xxx | |
# create branch to develop | |
git checkout -b dev | |
git add file1 | |
git commit ... | |
# fetch and rebase to upstream/master | |
git fetch upstream |
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
git tag -a v1.5.1 | |
git push —tags origin HEAD | |
#新建branch继续开发 | |
git checkout -b 1.5.1-bugfix | |
# 一些代码更改 | |
git commit -a -m 'bugfix commit' | |
# commit : e1d3f… | |
git push origin 1.5.1-bugfix |
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
############################################# | |
### Use watch to dump networking info | |
############################################# | |
watch -n 30 /root/script/dump_networking.sh &>/dev/null & | |
!/bin/sh | |
file_name=`date +%Y_%m_%d_%H_%M_%S`'.log' |
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
1) 试用 file 查看arch, | |
$ file libxiamiMusic_arm7.a | |
2) 提取各个arch的lib | |
lipo libxiamiMusic.a -thin armv7 -output libxiamiMusic_arm7.a | |
lipo libxiamiMusic.a -thin armv7s -output libxiamiMusic_arm7s.a | |
3) 去除重复 | |
方法- 解压处理单个arch的lib, | |
1. ar x libxiamiMusic_arm7.a |
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
mysql> show variables like 'character_set_%'; | |
+--------------------------+----------------------------+ | |
| Variable_name | Value | | |
+--------------------------+----------------------------+ | |
| character_set_client | latin1 | | |
| character_set_connection | latin1 | | |
| character_set_database | latin1 | | |
| character_set_filesystem | binary | | |
| character_set_results | latin1 | | |
| character_set_server | latin1 | |
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
// | |
// WebViewImageCache.m | |
// DoubanShuo | |
// | |
// Created by Jianjun Wu on 7/1/11. | |
// Copyright 2011 Douban Inc. All rights reserved. | |
// | |
#import "WebViewImageCache.h" | |
#import "UserAppPreference.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
to define : image size, position | |
{ | |
id:0, | |
type: 'pic', | |
content : { | |
title: "", | |
pic: "http://img3.douban.com/view/status/median/public/40feb715b79354c.jpg", | |
share_url:"" | |
} |
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
[ Finnaly with ffmpeg 2.2.4 ] | |
ffmpeg -f gif -i animation.gif -c:v libx264 -r 30 -pix_fmt yuv420p animation2.mp4 | |
[ install ffmpeg ]] | |
sudo add-apt-repository ppa:samrog131/ppa | |
sudo apt-get update | |
sudo apt-get install ffmpeg-real | |
- To check if ffmpeg was successfully installed | |
cd /opt/ffmpeg/bin |
NewerOlder