Skip to content

Instantly share code, notes, and snippets.

@bitmess
bitmess / iOS权限配置
Created June 27, 2017 11:11
iOS权限声明
<!-- 相册 -->
<key>NSPhotoLibraryUsageDescription</key>
<string>App需要您的同意,才能访问相册</string>
<!-- 相机 -->
<key>NSCameraUsageDescription</key>
<string>App需要您的同意,才能访问相机</string>
<!-- 麦克风 -->
<key>NSMicrophoneUsageDescription</key>
<string>App需要您的同意,才能访问麦克风</string>
<!-- 位置 -->
@bitmess
bitmess / 1.css
Created June 5, 2017 06:55
导出日志统计为html
/*!
* Bootstrap v2.3.2
*
* Copyright 2013 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world by @mdo and @fat.
*/.clearfix:before,.clearfix:after{display:table;content:"";line-height:0}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:24px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.break-line{word-break:break-all;word-wrap:break-word;white-space:pre}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{positi
@bitmess
bitmess / svn update folders
Last active June 5, 2017 07:12
svn update folders
#!/bin/bash
for file in ./*
do
if [ -d "$file" ]; then
svn up "$file"
fi
done
@bitmess
bitmess / reset git file statue to one commit
Created June 5, 2017 06:51
reset git file statue to one commit
#!/bin/sh
git reset 8304b56b434de4e13a4c3023b00814f94b40fb85 ./TrackController.m
git co -- ./TrackController.m
@bitmess
bitmess / record Mac SHUTDOWN & OPEN time
Created June 5, 2017 06:51
record Mac SHUTDOWN & OPEN time
#!/bin/sh
PATH=/Users/time_logo.txt
echo `/usr/bin/last shutdown | /usr/bin/sed -n '1p'` "stop" >> $PATH
echo `/bin/date` "start" >> $PATH
./configure --add-module=/Users/Desktop/nginx-rtmp-module-master --with-openssl=/Users/Desktop/openssl-master --with-zlib=/Users/Desktop/zlib-1.2.11 --with-pcre=/Users/Desktop/pcre-8.40 --with-stream --with-mail=dynamic --prefix=/Users/Documents/nginx
ffmpeg -re -i sample.flv -vcodec copy -acodec copy -f flv rtmp://192.168.90.26/hls/mystream
@bitmess
bitmess / git log for one file
Created June 5, 2017 06:50
git log for one file
#!/bin/sh
PATH=$1
if [ ! -f "$PATH" ];
then
echo "path is nil"
exit 0
fi
@bitmess
bitmess / git commit & push folders
Created June 5, 2017 06:50
git commit & push folders
#!/bin/sh
git add . && git ci -m merge && git pm
@bitmess
bitmess / find unused pics
Created June 5, 2017 06:50
find unused pics
#!/bin/sh
for i in `find . \( -path '*/Library' -o -path '*/Pods' \) -a -prune -o -name '*.jpg' -o -name '*.png' -print`; do
file=`basename -s .jpg "$i" | xargs basename -s .png | xargs basename -s @2x`
result=`ag -i "$file"`
if [ -z "$result" ]; then
echo "$i"
# 如果需要,可以直接执行删除:
# rm "$i"
fi
@bitmess
bitmess / find iOS app ipa's expiration
Created June 5, 2017 06:49
find iOS app ipa's expiration
#!/bin/sh
names=([0]="Demo1" [1]="Demo2")
urls=([0]="http://www.baidu.com/Demo1.ipa" [1]="http://www.baidu.com/Demo2.ipa")
rm -f ./1.txt
RES=""
function loop()
{